ProcessingBucket(final ProcessingBucketGroup<I> group, final ClusterInfo cluster, final ItemProcessor<I> processor, final AsyncErrorHandler errorHandler) { this.group = group; AsyncConfig config = group.getConfig(); if(config instanceof AsyncConfig2) { this.maxQueueSize = ((AsyncConfig2)config).getMaxQueueSize(); } else { this.maxQueueSize = 0; } this.stateLock = new TerracottaReadWriteLock(group.getConfig().isSynchronousWrite()); this.stateReadLock = stateLock.readLock(); this.stateWriteLock = stateLock.writeLock(); this.bucketLock = new TerracottaReadWriteLock(group.getConfig().isSynchronousWrite()); this.bucketWriteLock = bucketLock.writeLock(); this.bucketReadLock = bucketLock.readLock(); this.bucketIsEmpty = bucketWriteLock.newCondition(); this.bucketNotFull = bucketWriteLock.newCondition(); this.quarantineLock = new TerracottaReadWriteLock(group.getConfig().isSynchronousWrite()); this.quarantineWriteLock = quarantineLock.writeLock(); this.quarantineReadLock = quarantineLock.readLock(); this.cluster = ClusterInfoUtil.determineDsoClusterInstance(cluster); this.baselineTimestamp = System.currentTimeMillis(); this.processor = processor; if (null == errorHandler) { this.errorHandler = new LoggingErrorHandler(); } else { this.errorHandler = errorHandler; } }
ProcessingBucket(final ProcessingBucketGroup<I> group, final ClusterInfo cluster, final ItemProcessor<I> processor, final AsyncErrorHandler errorHandler) { this.group = group; AsyncConfig config = group.getConfig(); if(config instanceof AsyncConfig2) { this.maxQueueSize = ((AsyncConfig2)config).getMaxQueueSize(); } else { this.maxQueueSize = 0; } this.stateLock = new TerracottaReadWriteLock(group.getConfig().isSynchronousWrite()); this.stateReadLock = stateLock.readLock(); this.stateWriteLock = stateLock.writeLock(); this.bucketLock = new TerracottaReadWriteLock(group.getConfig().isSynchronousWrite()); this.bucketWriteLock = bucketLock.writeLock(); this.bucketReadLock = bucketLock.readLock(); this.bucketIsEmpty = bucketWriteLock.newCondition(); this.bucketNotFull = bucketWriteLock.newCondition(); this.quarantineLock = new TerracottaReadWriteLock(group.getConfig().isSynchronousWrite()); this.quarantineWriteLock = quarantineLock.writeLock(); this.quarantineReadLock = quarantineLock.readLock(); this.cluster = ClusterInfoUtil.determineDsoClusterInstance(cluster); this.baselineTimestamp = System.currentTimeMillis(); this.processor = processor; if (null == errorHandler) { this.errorHandler = new LoggingErrorHandler(); } else { this.errorHandler = errorHandler; } }