Example usage for java.util.concurrent ConcurrentLinkedQueue ConcurrentLinkedQueue

List of usage examples for java.util.concurrent ConcurrentLinkedQueue ConcurrentLinkedQueue

Introduction

In this page you can find the example usage for java.util.concurrent ConcurrentLinkedQueue ConcurrentLinkedQueue.

Prototype

public ConcurrentLinkedQueue() 

Source Link

Document

Creates a ConcurrentLinkedQueue that is initially empty.

Usage

From source file:m.c.m.proxyma.context.ProxyFolderBean.java

/**
 * Default constructor for this class it builds a destinationAsString.
 * NOTE: The folder is not ready to work as it is created.
 * Actually, it needs to be configured with at least a valid
 * resource retriver and a valid serializer.
 *
 * @param FolderName the path (and name) of the proxy folder.
 * @param destinationAsString the destinationAsString URI to masquerade
 * @param context the proxyma context where to get logger settings.
 * @throws NullArgumentException if some parameter is null
 * @throws IllegalArgumentException if the folder name or the destinationAsString parameter are invalid or malformed
 * @throws UnsupportedEncodingException if the default encoding charset specified on the configuration is not supported.
 *///from w  ww.  ja  v  a2 s.com
public ProxyFolderBean(String folderName, String destination, ProxymaContext context)
        throws NullArgumentException, IllegalArgumentException, UnsupportedEncodingException {
    log = context.getLogger();
    this.defaultEncoding = context.getDefaultEncoding();

    setFolderName(folderName);
    setDestination(destination);
    this.preprocessors = new ConcurrentLinkedQueue<String>();
    this.transformers = new ConcurrentLinkedQueue<String>();
    this.context = context;

    log.finer("ProxyFolder " + folderName + " for " + destination + "created.");
}

From source file:com.joshlong.esb.springintegration.modules.net.feed.FeedEntryReaderMessageSource.java

public FeedEntryReaderMessageSource() {
    this.receivedEntries = new ConcurrentSkipListSet<SyndEntry>(new MyComparator());
    this.entries = new ConcurrentLinkedQueue<SyndEntry>();
}

From source file:org.apache.streams.kafka.KafkaPersistReader.java

public KafkaPersistReader() {
    Config config = StreamsConfigurator.config.getConfig("kafka");
    this.config = KafkaConfigurator.detectConfiguration(config);
    this.persistQueue = new ConcurrentLinkedQueue<StreamsDatum>();
}

From source file:org.wso2.carbon.event.processor.storm.internal.listener.ConsumingQueuedEventSource.java

public ConsumingQueuedEventSource(StreamDefinition streamDefinition,
        ExecutionPlanConfiguration executionPlanConfiguration) {
    this.tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId();
    this.streamDefinition = streamDefinition;
    this.owner = executionPlanConfiguration;
    this.eventQueue = new ConcurrentLinkedQueue<Object[]>();
    this.traceEnabled = executionPlanConfiguration.isTracingEnabled();
    this.statisticsEnabled = executionPlanConfiguration.isStatisticsEnabled();
    if (statisticsEnabled) {
        statisticsMonitor = StormProcessorValueHolder.getEventStatisticsService().getEventStatisticMonitor(
                tenantId, StormProcessorConstants.STORM_PROCESSOR, executionPlanConfiguration.getName(),
                streamDefinition.getStreamId());
    }//from   w w  w.j av  a 2s  .  com
    if (traceEnabled) {
        this.tracerPrefix = "TenantId=" + tenantId + " : " + StormProcessorConstants.STORM_PROCESSOR + " : "
                + executionPlanConfiguration.getName() + "," + streamDefinition + ", before processing "
                + System.getProperty("line.separator");
    }
}

From source file:com.joshlong.esb.springintegration.modules.social.twitter.TwitterMessageSource.java

public void afterPropertiesSet() throws Exception {
    logger.debug("after properties set for TwitterMessageSource!!");

    if (twitter == null) {
        Assert.state(!StringUtils.isEmpty(userId));
        Assert.state(!StringUtils.isEmpty(password));

        twitter = new Twitter();
        twitter.setUserId(userId);//from  w w  w .jav  a2  s .co  m
        twitter.setPassword(password);
    } else { // it isnt null, in which case it becomes canonical memory
        setPassword(twitter.getPassword());
        setUserId(twitter.getUserId());
    }

    cachedStatuses = new ConcurrentLinkedQueue<Tweet>();
    lastStatusIdRetreived = -1;
}

From source file:org.apache.hadoop.hive.ql.DriverContext.java

public DriverContext(Context ctx) {
    this.runnable = new ConcurrentLinkedQueue<Task<? extends Serializable>>();
    this.running = new LinkedBlockingQueue<TaskRunner>();
    this.ctx = ctx;
}

From source file:eu.stratosphere.nephele.jobmanager.splitassigner.DefaultInputSplitAssigner.java

@Override
public void registerGroupVertex(final ExecutionGroupVertex groupVertex) {

    final InputSplit[] inputSplits = groupVertex.getInputSplits();

    if (inputSplits == null) {
        return;/*from   w w w .j  a  va  2 s  .  c om*/
    }

    if (inputSplits.length == 0) {
        return;
    }

    final Queue<InputSplit> queue = new ConcurrentLinkedQueue<InputSplit>();
    if (this.splitMap.putIfAbsent(groupVertex, queue) != null) {
        LOG.error("Group vertex " + groupVertex.getName() + " already has a split queue");
    }

    queue.addAll(Arrays.asList(inputSplits));
}

From source file:org.lockss.plugin.AuSearchSet.java

AuSearchSet() {
    aus = new ConcurrentLinkedQueue();
}

From source file:jetbrains.exodus.gc.GarbageCollector.java

public GarbageCollector(@NotNull final EnvironmentImpl env) {
    this.env = env;
    ec = env.getEnvironmentConfig();//  ww  w . ja  v  a 2  s .c o m
    pendingFilesToDelete = new LongHashSet();
    deletionQueue = new ConcurrentLinkedQueue<>();
    utilizationProfile = new UtilizationProfile(env, this);
    cleaner = new BackgroundCleaner(this);
    newFiles = ec.getGcFilesInterval() + 1;
    if (!ec.getGcUseExpirationChecker()) {
        expirationChecker = IExpirationChecker.NONE;
    } else {
        expirationChecker = new IExpirationChecker() {

            @Override
            public boolean expired(@NotNull final Loggable loggable) {
                return utilizationProfile.isExpired(loggable);
            }

            @Override
            public boolean expired(long startAddress, int length) {
                return utilizationProfile.isExpired(startAddress, length);
            }
        };
    }
    openStoresCache = new IntHashMap<>();
    env.getLog().addNewFileListener(new NewFileListener() {
        @Override
        public void fileCreated(long fileAddress) {
            ++newFiles;
            if (!cleaner.isCleaning() && newFiles > ec.getGcFilesInterval() && isTooMuchFreeSpace()) {
                wake();
            }
        }
    });
}

From source file:org.apache.hadoop.mapred.nativetask.buffer.DirectBufferPool.java

public void returnBuffer(ByteBuffer buffer) throws IOException {
    if (null == buffer || !buffer.isDirect()) {
        throw new IOException("the buffer is null or the buffer returned is not direct buffer");
    }//w w w. jav  a  2s .  c o m

    buffer.clear();
    int capacity = buffer.capacity();
    Queue<WeakReference<ByteBuffer>> list = bufferMap.get(capacity);
    if (null == list) {
        list = new ConcurrentLinkedQueue<WeakReference<ByteBuffer>>();
        Queue<WeakReference<ByteBuffer>> prev = bufferMap.putIfAbsent(capacity, list);
        if (prev != null) {
            list = prev;
        }
    }
    list.add(new WeakReference<ByteBuffer>(buffer));
}