@Override public void configure(Context context) { clientProps = new Properties(); hostname = context.getString("hostname"); port = context.getInteger("port"); Preconditions.checkState(hostname != null, "No hostname specified"); Preconditions.checkState(port != null, "No port specified"); clientProps.setProperty(RpcClientConfigurationConstants.CONFIG_HOSTS, "h1"); clientProps.setProperty(RpcClientConfigurationConstants.CONFIG_HOSTS_PREFIX + "h1", hostname + ":" + port); for (Entry<String, String> entry: context.getParameters().entrySet()) { clientProps.setProperty(entry.getKey(), entry.getValue()); } batchSize = AbstractRpcClient.parseBatchSize(clientProps); if (sinkCounter == null) { sinkCounter = new SinkCounter(getName()); } cxnResetInterval = context.getInteger("reset-connection-interval", DEFAULT_CXN_RESET_INTERVAL); if (cxnResetInterval == DEFAULT_CXN_RESET_INTERVAL) { logger.info("Connection reset is set to " + String.valueOf(DEFAULT_CXN_RESET_INTERVAL) + ". Will not reset connection to next hop"); } }
@Override public void configure(Context context) { this.context = context; maxBatchSize = context.getInteger(BATCH_SIZE, maxBatchSize); maxBatchDurationMillis = context.getLong(BATCH_DURATION_MILLIS, maxBatchDurationMillis); handlerClass = context.getString(HANDLER_CLASS, MorphlineHandlerImpl.class.getName()); if (sinkCounter == null) { sinkCounter = new SinkCounter(getName()); } }
/** * Sink configurations with Ignite-specific settings. * * @param context Context for sink. */ @Override public void configure(Context context) { springCfgPath = context.getString(IgniteSinkConstants.CFG_PATH); cacheName = context.getString(IgniteSinkConstants.CFG_CACHE_NAME); eventTransformerCls = context.getString(IgniteSinkConstants.CFG_EVENT_TRANSFORMER); batchSize = context.getInteger(IgniteSinkConstants.CFG_BATCH_SIZE, DFLT_BATCH_SIZE); if (sinkCounter == null) sinkCounter = new SinkCounter(getName()); }
this.sinkCounter = new SinkCounter(this.getName());
this.config.set(HConstants.ZOOKEEPER_ZNODE_PARENT, hbaseZnode); sinkCounter = new SinkCounter(this.getName());
this.config.set(HConstants.ZOOKEEPER_ZNODE_PARENT, hbaseZnode); sinkCounter = new SinkCounter(this.getName());
sinkCounter = new SinkCounter(this.getName());
@Override public void configure(Context context) { String pathManagerType = context.getString("sink.pathManager", "DEFAULT"); String directory = context.getString("sink.directory"); String rollInterval = context.getString("sink.rollInterval"); serializerType = context.getString("sink.serializer", "TEXT"); serializerContext = new Context(context.getSubProperties("sink." + EventSerializer.CTX_PREFIX)); Context pathManagerContext = new Context(context.getSubProperties("sink." + PathManager.CTX_PREFIX)); pathController = PathManagerFactory.getInstance(pathManagerType, pathManagerContext); Preconditions.checkArgument(directory != null, "Directory may not be null"); Preconditions.checkNotNull(serializerType, "Serializer type is undefined"); if (rollInterval == null) { this.rollInterval = defaultRollInterval; } else { this.rollInterval = Long.parseLong(rollInterval); } batchSize = context.getInteger("sink.batchSize", defaultBatchSize); this.directory = new File(directory); if (sinkCounter == null) { sinkCounter = new SinkCounter(getName()); } }
sinkCounter = new SinkCounter(getName()); sinkCounter = new SinkCounter(getName());
sinkCounter = new SinkCounter(getName());
@Override public void configure(Context context) { nameServer = context.getString(NAME_SERVER_CONFIG); if (nameServer == null) { throw new ConfigurationException("NameServer must not be null"); } topic = context.getString(TOPIC_CONFIG, TOPIC_DEFAULT); tag = context.getString(TAG_CONFIG, TAG_DEFAULT); producerGroup = context.getString(PRODUCER_GROUP_CONFIG, PRODUCER_GROUP_DEFAULT); batchSize = context.getInteger(BATCH_SIZE_CONFIG, BATCH_SIZE_DEFAULT); maxProcessTime = context.getLong(MAX_PROCESS_TIME_CONFIG, MAX_PROCESS_TIME_DEFAULT); if (sinkCounter == null) { sinkCounter = new SinkCounter(getName()); } }
DEFAULT_ROLL_INTERVAL); this.counter = new SinkCounter(datasetName);
sinkCounter = new SinkCounter(getName());
sinkCounter = new SinkCounter(getName());
@Override public void configure(Context context){ this.setName(NAME + counter.incrementAndGet()); this.batchSize = context.getInteger(FlumeConstants.CONFIG_BATCHSIZE, FlumeConstants.DEFAULT_BATCH_SIZE); final String eventSerializerType = context.getString(FlumeConstants.CONFIG_SERIALIZER); Preconditions.checkNotNull(eventSerializerType,"Event serializer cannot be empty, please specify in the configuration file"); initializeSerializer(context,eventSerializerType); this.sinkCounter = new SinkCounter(this.getName()); }
@Override public void configure(Context context){ this.setName(NAME + counter.incrementAndGet()); this.batchSize = context.getInteger(FlumeConstants.CONFIG_BATCHSIZE, FlumeConstants.DEFAULT_BATCH_SIZE); final String eventSerializerType = context.getString(FlumeConstants.CONFIG_SERIALIZER); Preconditions.checkNotNull(eventSerializerType,"Event serializer cannot be empty, please specify in the configuration file"); initializeSerializer(context,eventSerializerType); this.sinkCounter = new SinkCounter(this.getName()); }
@Override public void configure(Context context) { clientProps = new Properties(); hostname = context.getString("hostname"); port = context.getInteger("port"); Preconditions.checkState(hostname != null, "No hostname specified"); Preconditions.checkState(port != null, "No port specified"); clientProps.setProperty(RpcClientConfigurationConstants.CONFIG_HOSTS, "h1"); clientProps.setProperty(RpcClientConfigurationConstants.CONFIG_HOSTS_PREFIX + "h1", hostname + ":" + port); for (Entry<String, String> entry: context.getParameters().entrySet()) { clientProps.setProperty(entry.getKey(), entry.getValue()); } batchSize = AbstractRpcClient.parseBatchSize(clientProps); if (sinkCounter == null) { sinkCounter = new SinkCounter(getName()); } cxnResetInterval = context.getInteger("reset-connection-interval", DEFAULT_CXN_RESET_INTERVAL); if (cxnResetInterval == DEFAULT_CXN_RESET_INTERVAL) { logger.info("Connection reset is set to " + String.valueOf(DEFAULT_CXN_RESET_INTERVAL) + ". Will not reset connection to next hop"); } }
@Override public void configure(Context context) { this.context = context; maxBatchSize = context.getInteger(BATCH_SIZE, maxBatchSize); maxBatchDurationMillis = context.getLong(BATCH_DURATION_MILLIS, maxBatchDurationMillis); handlerClass = context.getString(HANDLER_CLASS, MorphlineHandlerImpl.class.getName()); if (sinkCounter == null) { sinkCounter = new SinkCounter(getName()); } }
@Override public void configure(Context context) { String pathManagerType = context.getString("sink.pathManager", "DEFAULT"); String directory = context.getString("sink.directory"); String rollInterval = context.getString("sink.rollInterval"); serializerType = context.getString("sink.serializer", "TEXT"); serializerContext = new Context(context.getSubProperties("sink." + EventSerializer.CTX_PREFIX)); Context pathManagerContext = new Context(context.getSubProperties("sink." + PathManager.CTX_PREFIX)); pathController = PathManagerFactory.getInstance(pathManagerType, pathManagerContext); Preconditions.checkArgument(directory != null, "Directory may not be null"); Preconditions.checkNotNull(serializerType, "Serializer type is undefined"); if (rollInterval == null) { this.rollInterval = defaultRollInterval; } else { this.rollInterval = Long.parseLong(rollInterval); } batchSize = context.getInteger("sink.batchSize", defaultBatchSize); this.directory = new File(directory); if (sinkCounter == null) { sinkCounter = new SinkCounter(getName()); } }
@Override public void configure(Context context) { indexService = context.getString(INDEX_SERVICE); discoveryPath = context.getString(DISCOVERY_PATH); dimensions = Arrays.asList(context.getString(DIMENSIONS).split(",")); firehosePattern = context.getString(FIREHOSE_PATTERN, DEFAULT_FIREHOSE); dataSource = context.getString(DATA_SOURCE, DEFAUL_DATASOURCE); aggregators = AggregatorsHelper.build(context.getString(AGGREGATORS)); queryGranularity = QueryGranularityHelper.getGranularity(context.getString(QUERY_GRANULARITY, DEFAULT_QUERY_GRANULARITY)); segmentGranularity = Granularity.valueOf(context.getString(SEGMENT_GRANULARITY, DEFAULT_SEGMENT_GRANULARITY)); period = context.getString(WINDOW_PERIOD, DEFAULT_PERIOD); partitions = context.getInteger(PARTITIONS, DEFAULT_PARTITIONS); replicants = context.getInteger(REPLICANTS, DEFAULT_REPLICANTS); // Tranquility needs to be able to extract timestamps from your object type (in this case, Map<String, Object>). timestampField = context.getString(TIMESTAMP_FIELD, DEFAULT_TIMESTAMP_FIELD); zookeeperLocation = context.getString(ZOOKEEPER_LOCATION, DEFAULT_ZOOKEEPER_LOCATION); baseSleppTime = context.getInteger(ZOOKEEPPER_BASE_SLEEP_TIME, DEFAULT_ZOOKEEPER_BASE_SLEEP); maxRetries = context.getInteger(ZOOKEEPER_MAX_RETRIES, DEFAULT_ZOOKEEPER_MAX_RETRIES); maxSleep = context.getInteger(ZOOKEEPER_MAX_SLEEP, DEFAULT_ZOOKEEPER_MAX_SLEEP); batchSize = context.getInteger(BATCH_SIZE, DEFAULT_BATCH_SIZE); druidService = buildDruidService(); sinkCounter = new SinkCounter(this.getName()); eventParser = new EventParser(timestampField); }