コード例 #1
0
	def _initialize_members(self,conf):
		
		self._collector_path = None
		self._hdfs_root_path = None
		self._queue_name = None
		self._pkt_num = None
		self._pcap_split_staging = None
		self._time_to_wait = None
		self._dsource='dns'

		# valdiate configuration info.
                conf_err_msg = "Please provide a valid '{0}' in the configuration file"
                util.validate_parameter(conf['collector_path'],conf_err_msg.format("collector_path"))
                #util.validate_parameter(conf['hdfs_root_path'],conf_err_msg.format("hdfs_root_path"))
                util.validate_parameter(conf['queue_name'],conf_err_msg.format("queue_name"))
                util.validate_parameter(conf['pkt_num'],conf_err_msg.format("pkt_num"))
                util.validate_parameter(conf['pcap_split_staging'],conf_err_msg.format("pcap_split_staging"))
                util.validate_parameter(conf['time_to_wait'],conf_err_msg.format("time_to_wait"))

		# set configuration.
		self._collector_path = conf['collector_path']
                self._hdfs_root_path =  os.environ['HUSER']+'/'+self._dsource
                self._time_to_wait = conf['time_to_wait']
		self._pkt_num = conf['pkt_num']
                self._pcap_split_staging = conf['pcap_split_staging']
	 	self._queue_name = conf['queue_name']
コード例 #2
0
	def _initialize_members(self,conf):
	
		self._collector_path = None
                self._hdfs_root_path = None
                self._queue_name = None
                self._dsource = 'flow'

		# valdiate configuration info.
                conf_err_msg = "Please provide a valid '{0}' in the configuration file"
                util.validate_parameter(conf['collector_path'],conf_err_msg.format("collector_path"))
                #util.validate_parameter(conf['hdfs_root_path'],conf_err_msg.format("hdfs_root_path"))
                util.validate_parameter(conf['queue_name'],conf_err_msg.format("queue_name"))
 
               	# set configuration.
		self._collector_path = conf['collector_path']
                self._hdfs_root_path = os.environ['HUSER']+'/'+self._dsource
               	self._queue_name = conf['queue_name']