/** * @see stream.io.Source#init() */ @Override public void init() throws Exception { if (getCapacity() < 1) throw new IllegalArgumentException("Invalid queue-capacity '" + getCapacity() + "'!"); if (index == null || index.isEmpty()) throw new IllegalArgumentException("Index is not specified"); if (streams == null || streams.size() == 0) throw new IllegalArgumentException("Index is not specified"); if (sync == null || sync.isEmpty()) throw new IllegalArgumentException("Index is not specified"); for (String unit : streams) { queues.put(unit, new SnappyBlockingQueue(capacity)); } reads = streams.size(); readQueue = new String[reads]; dataQueue = new Data[reads]; accs = new long[reads]; int j = 0; for (String unit : streams) { readQueue[j] = unit; j++; } }
/** * @see stream.io.Source#init() */ @Override public void init() throws Exception { if (getCapacity() < 1) throw new IllegalArgumentException("Invalid queue-capacity '" + getCapacity() + "'!"); if (index == null || index.isEmpty()) throw new IllegalArgumentException("Index is not specified"); if (streams == null || streams.size() == 0) throw new IllegalArgumentException("Index is not specified"); if (sync == null || sync.isEmpty()) throw new IllegalArgumentException("Index is not specified"); for (String unit : streams) { queues.put(unit, new SnappyBlockingQueue(capacity)); } reads = streams.size(); readQueue = new String[reads]; dataQueue = new Data[reads]; accs = new long[reads]; int j = 0; for (String unit : streams) { readQueue[j] = unit; j++; } }