/** * AbstractMongoBolt Constructor. * @param url The MongoDB server url * @param collectionName The collection where reading/writing data */ public AbstractMongoBolt(String url, String collectionName) { Validate.notEmpty(url, "url can not be blank or null"); Validate.notEmpty(collectionName, "collectionName can not be blank or null"); this.url = url; this.collectionName = collectionName; }
public SimpleJdbcMapper(List<Column> schemaColumns) { Validate.notEmpty(schemaColumns); this.schemaColumns = schemaColumns; }
/** * <p>Validate that the specified argument collection is neither <code>null</code> * nor a size of zero (no elements); otherwise throwing an exception. * * <pre>Validate.notEmpty(myCollection);</pre> * * <p>The message in the exception is "The validated collection is * empty".</p> * * @param collection the collection to check * @throws IllegalArgumentException if the collection is empty */ public static void notEmpty(Collection collection) { notEmpty(collection, "The validated collection is empty"); }
/** * <p>Validate that the specified argument map is neither <code>null</code> * nor a size of zero (no elements); otherwise throwing an exception. * * <pre>Validate.notEmpty(myMap);</pre> * * <p>The message in the exception is "The validated map is * empty".</p> * * @param map the map to check * @throws IllegalArgumentException if the map is empty * @see #notEmpty(Map, String) */ public static void notEmpty(Map map) { notEmpty(map, "The validated map is empty"); }
/** * <p>Validate that the specified argument array is neither <code>null</code> * nor a length of zero (no elements); otherwise throwing an exception. * * <pre>Validate.notEmpty(myArray);</pre> * * <p>The message in the exception is "The validated array is * empty". * * @param array the array to check * @throws IllegalArgumentException if the array is empty */ public static void notEmpty(Object[] array) { notEmpty(array, "The validated array is empty"); }
/** * <p>Validate that the specified argument string is * neither <code>null</code> nor a length of zero (no characters); * otherwise throwing an exception with the specified message. * * <pre>Validate.notEmpty(myString);</pre> * * <p>The message in the exception is "The validated * string is empty".</p> * * @param string the string to check * @throws IllegalArgumentException if the string is empty */ public static void notEmpty(String string) { notEmpty(string, "The validated string is empty"); }
@Override public void prepare(Map<String, Object> conf) { this.isoMachines = (Map<String, Number>) conf.get(DaemonConfig.ISOLATION_SCHEDULER_MACHINES); Validate.notEmpty(isoMachines); }
public AbstractHBaseBolt(String tableName, HBaseMapper mapper) { Validate.notEmpty(tableName, "Table name can not be blank or null"); Validate.notNull(mapper, "mapper can not be null"); this.tableName = tableName; this.mapper = mapper; }
protected MongoMapState(Map<String, Object> map, Options options) { this.options = options; this.map = map; this.serializer = options.serializer; Validate.notEmpty(options.url, "url can not be blank or null"); Validate.notEmpty(options.collectionName, "collectionName can not be blank or null"); Validate.notNull(options.queryCreator, "queryCreator can not be null"); Validate.notNull(options.mapper, "mapper can not be null"); this.mongoClient = new MongoDbClient(options.url, options.collectionName); }
/** * RocketMqSpout Constructor. * @param properties Properties Config */ public RocketMqSpout(Properties properties) { Validate.notEmpty(properties, "Consumer properties can not be empty"); this.properties = properties; scheme = RocketMqUtils.createScheme(properties); }
public SimpleJdbcLookupMapper(Fields outputFields, List<Column> queryColumns) { super(queryColumns); Validate.notEmpty(outputFields.toList()); this.outputFields = outputFields; }
/** * Constructor. * * @param legs List of legs for this itinerary. */ public Itinerary(final List<Leg> legs) { Validate.notEmpty(legs); Validate.noNullElements(legs); this.legs = legs; }
Schedule(final List<CarrierMovement> carrierMovements) { Validate.notNull(carrierMovements); Validate.noNullElements(carrierMovements); Validate.notEmpty(carrierMovements); this.carrierMovements = carrierMovements; }
protected void prepare() { Validate.notEmpty(options.properties, "Producer properties can not be empty"); Validate.notNull(options.selector, "TopicSelector can not be null"); Validate.notNull(options.mapper, "TupleToMessageMapper can not be null"); producer = new DefaultMQProducer(); producer.setInstanceName(UUID.randomUUID().toString()); RocketMqConfig.buildProducerConfigs(options.properties, producer); try { producer.start(); } catch (MQClientException e) { throw new RuntimeException(e); } }
/** * @param keyStorePath * the keyStorePath to set */ public void setKeyStore( String keyStore ) { Validate.notNull( keyStore, BaseMessages.getString( PKG, "WebServer.Error.IllegalSslParameter", XML_TAG_KEY_STORE, NULL ) ); Validate.notEmpty( keyStore, BaseMessages.getString( PKG, "WebServer.Error.IllegalSslParameter", XML_TAG_KEY_STORE, EMPTY ) ); this.keyStore = keyStore; }
/** * @param keyStorePassword * the keyStorePassword to set */ public void setKeyStorePassword( String keyStorePassword ) { Validate.notNull( keyStorePassword, BaseMessages.getString( PKG, "WebServer.Error.IllegalSslParameter", XML_TAG_KEY_STORE_PASSWORD, NULL ) ); Validate.notEmpty( keyStorePassword, BaseMessages.getString( PKG, "WebServer.Error.IllegalSslParameter", XML_TAG_KEY_STORE_PASSWORD, EMPTY ) ); this.keyStorePassword = keyStorePassword; }
public SimpleJdbcMapper(String tableName, ConnectionProvider connectionProvider) { Validate.notEmpty(tableName); Validate.notNull(connectionProvider); int queryTimeoutSecs = 30; connectionProvider.prepare(); JdbcClient client = new JdbcClient(connectionProvider, queryTimeoutSecs); this.schemaColumns = client.getColumnSchema(tableName); }
@Override public void prepare(Map<String, Object> topoConf, TopologyContext context, OutputCollector collector) { Validate.notEmpty(properties, "Producer properties can not be empty"); Validate.notNull(selector, "TopicSelector can not be null"); Validate.notNull(mapper, "TupleToMessageMapper can not be null"); producer = new DefaultMQProducer(); producer.setInstanceName(String.valueOf(context.getThisTaskId())); RocketMqConfig.buildProducerConfigs(properties, producer); try { producer.start(); } catch (MQClientException e) { throw new RuntimeException(e); } this.collector = collector; this.batchHelper = new BatchHelper(batchSize, collector); this.messages = new LinkedList<>(); }
/** * Build Common Configs. * @param props Properties * @param client ClientConfig */ public static void buildCommonConfigs(Properties props, ClientConfig client) { String nameServers = props.getProperty(NAME_SERVER_ADDR); Validate.notEmpty(nameServers); client.setNamesrvAddr(nameServers); client.setPollNameServerInterval(getInteger(props, NAME_SERVER_POLL_INTERVAL, DEFAULT_NAME_SERVER_POLL_INTERVAL)); client.setHeartbeatBrokerInterval(getInteger(props, BROKER_HEART_BEAT_INTERVAL, DEFAULT_BROKER_HEART_BEAT_INTERVAL)); } }