Package org.apache.cassandra.concurrent

Examples of org.apache.cassandra.concurrent.DebuggableThreadPoolExecutor


    }

    public void run()
    {       
      /* For DEBUG only. Printing queue length */  
      DebuggableThreadPoolExecutor es = (DebuggableThreadPoolExecutor)MessagingService.getWriteExecutor();
        logger_.debug( "Message Serialization Task: " + (es.getTaskCount() - es.getCompletedTaskCount()) );
        /* END DEBUG */
       
        /* Adding the message to be serialized in the TLS. For accessing in the afterExecute() */
        Context ctx = new Context();
        ctx.put(this.getClass().getName(), message_);
View Full Code Here


        MessagingService.getMessagingInstance().registerVerbHandlers(StorageService.calloutDeployVerbHandler_, new CalloutDeployVerbHandler() );
        MessagingService.getMessagingInstance().registerVerbHandlers(StorageService.touchVerbHandler_, new TouchVerbHandler());
       
        /* register the stage for the mutations */
        int threadCount = DatabaseDescriptor.getThreadsPerPool();
        consistencyManager_ = new DebuggableThreadPoolExecutor(threadCount,
            threadCount,
                Integer.MAX_VALUE, TimeUnit.SECONDS,
                new LinkedBlockingQueue<Runnable>(), new ThreadFactoryImpl(
                        "CONSISTENCY-MANAGER"));
       
View Full Code Here

        */
        int maxSize = MessagingConfig.getMessagingThreadCount();
        callbackMap_ = new Cachetable<String, IAsyncCallback>( 2 * DatabaseDescriptor.getRpcTimeout() );
        taskCompletionMap_ = new Cachetable<String, IAsyncResult>( 2 * DatabaseDescriptor.getRpcTimeout() );       
       
        messageDeserializationExecutor_ = new DebuggableThreadPoolExecutor( maxSize,
                maxSize,
                Integer.MAX_VALUE,
                TimeUnit.SECONDS,
                new LinkedBlockingQueue<Runnable>(),
                new ThreadFactoryImpl("MESSAGING-SERVICE-POOL")
                );
               
        messageSerializerExecutor_ = new DebuggableThreadPoolExecutor( maxSize,
                maxSize,
                Integer.MAX_VALUE,
                TimeUnit.SECONDS,
                new LinkedBlockingQueue<Runnable>(),
                new ThreadFactoryImpl("MESSAGE-SERIALIZER-POOL")
                );
       
        messageDeserializerExecutor_ = new DebuggableThreadPoolExecutor( maxSize,
                maxSize,
                Integer.MAX_VALUE,
                TimeUnit.SECONDS,
                new LinkedBlockingQueue<Runnable>(),
                new ThreadFactoryImpl("MESSAGE-DESERIALIZER-POOL")
                );
       
        streamExecutor_ = new DebuggableThreadPoolExecutor( 1,
                1,
                Integer.MAX_VALUE,
                TimeUnit.SECONDS,
                new LinkedBlockingQueue<Runnable>(),
                new ThreadFactoryImpl("MESSAGE-STREAMING-POOL")
View Full Code Here

        return result;
    }
   
    public long getMessagingSerializerTaskCount()
    {
        DebuggableThreadPoolExecutor dstp = (DebuggableThreadPoolExecutor)messageSerializerExecutor_;       
        return dstp.getTaskCount() - dstp.getCompletedTaskCount();
    }
View Full Code Here

        return dstp.getTaskCount() - dstp.getCompletedTaskCount();
    }
   
    public long getMessagingReceiverTaskCount()
    {
        DebuggableThreadPoolExecutor dstp = (DebuggableThreadPoolExecutor)messageDeserializationExecutor_;       
        return dstp.getTaskCount() - dstp.getCompletedTaskCount();
    }
View Full Code Here

    }
   
    public void run()
    {
      /* For DEBUG only. Printing queue length */  
      DebuggableThreadPoolExecutor es = (DebuggableThreadPoolExecutor)MessagingService.getDeserilizationExecutor();
        logger_.debug( "Message Deserialization Task: " + (es.getTaskCount() - es.getCompletedTaskCount()) );
        /* END DEBUG */
        try
        {                       
            Message message = (Message)serializer_.deserialize(bytes_);                                                          
           
View Full Code Here

     * @param to endpoint to which we need to stream the file.
    */

    public void stream(StreamHeader header, InetAddress to)
    {
        DebuggableThreadPoolExecutor executor = streamExecutors.get(to);
        if (executor == null)
        {
            // Using a core pool size of 0 is important. See documentation of streamExecutors.
            executor = DebuggableThreadPoolExecutor.createWithMaximumPoolSize("Streaming to " + to, 1, 1, TimeUnit.SECONDS);
            DebuggableThreadPoolExecutor old = streamExecutors.putIfAbsent(to, executor);
            if (old != null)
            {
                executor.shutdown();
                executor = old;
            }
View Full Code Here

         * pool that retrives the callback from here.
        */
        callbackMap_ = new ExpiringMap<String, IAsyncCallback>((long) (1.1 * DatabaseDescriptor.getRpcTimeout()));
        taskCompletionMap_ = new ExpiringMap<String, IAsyncResult>((long) (1.1 * DatabaseDescriptor.getRpcTimeout()));

        streamExecutor_ = new DebuggableThreadPoolExecutor("Streaming", DatabaseDescriptor.getCompactionThreadPriority());
        Runnable logDropped = new Runnable()
        {
            public void run()
            {
                logDroppedMessages();
View Full Code Here

     * @param to     endpoint to which we need to stream the file.
     */

    public void stream(StreamHeader header, InetAddress to)
    {
        DebuggableThreadPoolExecutor executor = streamExecutors.get(to);
        if (executor == null)
        {
            // Using a core pool size of 0 is important. See documentation of streamExecutors.
            executor = DebuggableThreadPoolExecutor.createWithMaximumPoolSize("Streaming to " + to, 1, 1, TimeUnit.SECONDS);
            DebuggableThreadPoolExecutor old = streamExecutors.putIfAbsent(to, executor);
            if (old != null)
            {
                executor.shutdown();
                executor = old;
            }
View Full Code Here

            lastDroppedInternal.put(verb, 0);
        }

        listenGate = new SimpleCondition();
        verbHandlers_ = new EnumMap<StorageService.Verb, IVerbHandler>(StorageService.Verb.class);
        streamExecutor_ = new DebuggableThreadPoolExecutor("Streaming", Thread.MIN_PRIORITY);
        Runnable logDropped = new Runnable()
        {
            public void run()
            {
                logDroppedMessages();
View Full Code Here

TOP

Related Classes of org.apache.cassandra.concurrent.DebuggableThreadPoolExecutor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.