• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java DebuggableThreadPoolExecutor类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.apache.cassandra.concurrent.DebuggableThreadPoolExecutor的典型用法代码示例。如果您正苦于以下问题:Java DebuggableThreadPoolExecutor类的具体用法?Java DebuggableThreadPoolExecutor怎么用?Java DebuggableThreadPoolExecutor使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



DebuggableThreadPoolExecutor类属于org.apache.cassandra.concurrent包,在下文中一共展示了DebuggableThreadPoolExecutor类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: afterExecute

import org.apache.cassandra.concurrent.DebuggableThreadPoolExecutor; //导入依赖的package包/类
@Override
public void afterExecute(Runnable r, Throwable t)
{
    DebuggableThreadPoolExecutor.maybeResetTraceSessionWrapper(r);
    
    if (t == null)
        t = DebuggableThreadPoolExecutor.extractThrowable(r);

    if (t != null)
    {
        if (t instanceof CompactionInterruptedException)
        {
            logger.info(t.getMessage());
            if (t.getSuppressed() != null && t.getSuppressed().length > 0)
                logger.warn("Interruption of compaction encountered exceptions:", t);
            else
                logger.debug("Full interruption stack trace:", t);
        }
        else
        {
            DebuggableThreadPoolExecutor.handleOrLog(t);
        }
    }
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:25,代码来源:CompactionManager.java


示例2: afterExecute

import org.apache.cassandra.concurrent.DebuggableThreadPoolExecutor; //导入依赖的package包/类
@Override
public void afterExecute(Runnable r, Throwable t)
{
    super.afterExecute(r, t);

    if (t == null)
        t = DebuggableThreadPoolExecutor.extractThrowable(r);

    if (t != null)
    {
        if (t instanceof CompactionInterruptedException)
        {
            logger.info(t.getMessage());
            logger.debug("Full interruption stack trace:", t);
        }
        else
        {
            DebuggableThreadPoolExecutor.handleOrLog(t);
        }
    }
}
 
开发者ID:pgaref,项目名称:ACaZoo,代码行数:22,代码来源:CompactionManager.java


示例3: afterExecute

import org.apache.cassandra.concurrent.DebuggableThreadPoolExecutor; //导入依赖的package包/类
@Override
public void afterExecute(Runnable r, Throwable t)
{
    DebuggableThreadPoolExecutor.maybeResetTraceSessionWrapper(r);
    
    if (t == null)
        t = DebuggableThreadPoolExecutor.extractThrowable(r);

    if (t != null)
    {
        if (t instanceof CompactionInterruptedException)
        {
            logger.info(t.getMessage());
            logger.debug("Full interruption stack trace:", t);
        }
        else
        {
            DebuggableThreadPoolExecutor.handleOrLog(t);
        }
    }
}
 
开发者ID:daidong,项目名称:GraphTrek,代码行数:22,代码来源:CompactionManager.java


示例4: afterExecute

import org.apache.cassandra.concurrent.DebuggableThreadPoolExecutor; //导入依赖的package包/类
@Override
public void afterExecute(Runnable r, Throwable t)
{
    super.afterExecute(r,t);

    if (t == null)
        t = DebuggableThreadPoolExecutor.extractThrowable(r);

    if (t != null)
    {
        if (t instanceof CompactionInterruptedException)
        {
            logger.info(t.getMessage());
            logger.debug("Full interruption stack trace:", t);
        }
        else
        {
            DebuggableThreadPoolExecutor.handleOrLog(t);
        }
    }
}
 
开发者ID:dprguiuc,项目名称:Cassandra-Wasef,代码行数:22,代码来源:CompactionManager.java


示例5: stream

import org.apache.cassandra.concurrent.DebuggableThreadPoolExecutor; //导入依赖的package包/类
/**
 * Stream a file from source to destination. This is highly optimized
 * to not hold any of the contents of the file in memory.
 *
 * @param header Header contains file to stream and other metadata.
 * @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;
        }
    }

    executor.execute(header.file == null || header.file.compressionInfo == null
                     ? new FileStreamTask(header, to)
                     : new CompressedFileStreamTask(header, to));
}
 
开发者ID:dprguiuc,项目名称:Cassandra-Wasef,代码行数:28,代码来源:MessagingService.java


示例6: HintsWriteExecutor

import org.apache.cassandra.concurrent.DebuggableThreadPoolExecutor; //导入依赖的package包/类
HintsWriteExecutor(HintsCatalog catalog)
{
    this.catalog = catalog;

    writeBuffer = ByteBuffer.allocateDirect(WRITE_BUFFER_SIZE);
    executor = DebuggableThreadPoolExecutor.createWithFixedPoolSize("HintsWriteExecutor", 1);
}
 
开发者ID:scylladb,项目名称:scylla-tools-java,代码行数:8,代码来源:HintsWriteExecutor.java


示例7: afterExecute

import org.apache.cassandra.concurrent.DebuggableThreadPoolExecutor; //导入依赖的package包/类
@Override
public void afterExecute(Runnable r, Throwable t)
{
    DebuggableThreadPoolExecutor.maybeResetTraceSessionWrapper(r);
    
    if (t == null)
        t = DebuggableThreadPoolExecutor.extractThrowable(r);

    if (t != null)
    {
        if (t instanceof CompactionInterruptedException)
        {
            logger.info(t.getMessage());
            if (t.getSuppressed() != null && t.getSuppressed().length > 0)
                logger.warn("Interruption of compaction encountered exceptions:", t);
            else
                logger.trace("Full interruption stack trace:", t);
        }
        else
        {
            DebuggableThreadPoolExecutor.handleOrLog(t);
        }
    }

    // Snapshots cannot be deleted on Windows while segments of the root element are mapped in NTFS. Compactions
    // unmap those segments which could free up a snapshot for successful deletion.
    SnapshotDeletingTask.rescheduleFailedTasks();
}
 
开发者ID:scylladb,项目名称:scylla-tools-java,代码行数:29,代码来源:CompactionManager.java


示例8: afterExecute

import org.apache.cassandra.concurrent.DebuggableThreadPoolExecutor; //导入依赖的package包/类
@Override
protected void afterExecute(Runnable r, Throwable t)
{
    super.afterExecute(r, t);
    DebuggableThreadPoolExecutor.logExceptionsAfterExecute(r, t);
    state.get().logout();
}
 
开发者ID:devdattakulkarni,项目名称:Cassandra-KVPM,代码行数:8,代码来源:AbstractCassandraDaemon.java


示例9: openAll

import org.apache.cassandra.concurrent.DebuggableThreadPoolExecutor; //导入依赖的package包/类
public static Collection<SSTableReader> openAll(Set<Map.Entry<Descriptor, Set<Component>>> entries,
                                                  final CFMetaData metadata,
                                                  final IPartitioner partitioner)
{
    final Collection<SSTableReader> sstables = new LinkedBlockingQueue<>();

    ExecutorService executor = DebuggableThreadPoolExecutor.createWithFixedPoolSize("SSTableBatchOpen", FBUtilities.getAvailableProcessors());
    for (final Map.Entry<Descriptor, Set<Component>> entry : entries)
    {
        Runnable runnable = new Runnable()
        {
            public void run()
            {
                SSTableReader sstable;
                try
                {
                    sstable = open(entry.getKey(), entry.getValue(), metadata, partitioner);
                }
                catch (IOException ex)
                {
                    logger.error("Corrupt sstable {}; skipped", entry, ex);
                    return;
                }
                sstables.add(sstable);
            }
        };
        executor.submit(runnable);
    }

    executor.shutdown();
    try
    {
        executor.awaitTermination(7, TimeUnit.DAYS);
    }
    catch (InterruptedException e)
    {
        throw new AssertionError(e);
    }

    return sstables;

}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:43,代码来源:SSTableReader.java


示例10: afterExecute

import org.apache.cassandra.concurrent.DebuggableThreadPoolExecutor; //导入依赖的package包/类
@Override
protected void afterExecute(Runnable r, Throwable t)
{
    super.afterExecute(r, t);
    DebuggableThreadPoolExecutor.logExceptionsAfterExecute(r, t);
}
 
开发者ID:pgaref,项目名称:ACaZoo,代码行数:7,代码来源:RequestThreadPoolExecutor.java


示例11: openAll

import org.apache.cassandra.concurrent.DebuggableThreadPoolExecutor; //导入依赖的package包/类
public static Collection<SSTableReader> openAll(Set<Map.Entry<Descriptor, Set<Component>>> entries,
                                                  final CFMetaData metadata,
                                                  final IPartitioner partitioner)
{
    final Collection<SSTableReader> sstables = new LinkedBlockingQueue<SSTableReader>();

    ExecutorService executor = DebuggableThreadPoolExecutor.createWithFixedPoolSize("SSTableBatchOpen", FBUtilities.getAvailableProcessors());
    for (final Map.Entry<Descriptor, Set<Component>> entry : entries)
    {
        Runnable runnable = new Runnable()
        {
            public void run()
            {
                SSTableReader sstable;
                try
                {
                    sstable = open(entry.getKey(), entry.getValue(), metadata, partitioner);
                }
                catch (IOException ex)
                {
                    logger.error("Corrupt sstable " + entry + "; skipped", ex);
                    return;
                }
                sstables.add(sstable);
            }
        };
        executor.submit(runnable);
    }

    executor.shutdown();
    try
    {
        executor.awaitTermination(7, TimeUnit.DAYS);
    }
    catch (InterruptedException e)
    {
        throw new AssertionError(e);
    }

    return sstables;

}
 
开发者ID:pgaref,项目名称:ACaZoo,代码行数:43,代码来源:SSTableReader.java


示例12: openAll

import org.apache.cassandra.concurrent.DebuggableThreadPoolExecutor; //导入依赖的package包/类
public static Collection<SSTableReader> openAll(Set<Map.Entry<Descriptor, Set<Component>>> entries,
                                                final CFMetaData metadata,
                                                final IPartitioner partitioner)
{
    final Collection<SSTableReader> sstables = new LinkedBlockingQueue<SSTableReader>();

    ExecutorService executor = DebuggableThreadPoolExecutor.createWithFixedPoolSize("SSTableBatchOpen", FBUtilities.getAvailableProcessors());
    for (final Map.Entry<Descriptor, Set<Component>> entry : entries)
    {
        Runnable runnable = new Runnable()
        {
            public void run()
            {
                SSTableReader sstable;
                try
                {
                    sstable = open(entry.getKey(), entry.getValue(), metadata, partitioner);
                }
                catch (IOException ex)
                {
                    logger.error("Corrupt sstable " + entry + "; skipped", ex);
                    return;
                }
                sstables.add(sstable);
            }
        };
        executor.submit(runnable);
    }

    executor.shutdown();
    try
    {
        executor.awaitTermination(7, TimeUnit.DAYS);
    }
    catch (InterruptedException e)
    {
        throw new AssertionError(e);
    }

    return sstables;

}
 
开发者ID:dprguiuc,项目名称:Cassandra-Wasef,代码行数:43,代码来源:SSTableReader.java


示例13: MessagingService

import org.apache.cassandra.concurrent.DebuggableThreadPoolExecutor; //导入依赖的package包/类
private MessagingService()
{
    for (StorageService.Verb verb : DROPPABLE_VERBS)
    {
        droppedMessages.put(verb, new AtomicInteger());
        lastDropped.put(verb, 0);
        lastDroppedInternal.put(verb, 0);
    }

    listenGate = new SimpleCondition();
    verbHandlers_ = new EnumMap<StorageService.Verb, IVerbHandler>(StorageService.Verb.class);
    streamExecutor_ = new DebuggableThreadPoolExecutor("Streaming", DatabaseDescriptor.getCompactionThreadPriority());
    Runnable logDropped = new Runnable()
    {
        public void run()
        {
            logDroppedMessages();
        }
    };
    StorageService.scheduledTasks.scheduleWithFixedDelay(logDropped, LOG_DROPPED_INTERVAL_IN_MS, LOG_DROPPED_INTERVAL_IN_MS, TimeUnit.MILLISECONDS);

    Function<Pair<String, Pair<InetAddress, IMessageCallback>>, ?> timeoutReporter = new Function<Pair<String, Pair<InetAddress, IMessageCallback>>, Object>()
    {
        public Object apply(Pair<String, Pair<InetAddress, IMessageCallback>> pair)
        {
            Pair<InetAddress, IMessageCallback> expiredValue = pair.right;
            maybeAddLatency(expiredValue.right, expiredValue.left, (double) DatabaseDescriptor.getRpcTimeout());
            totalTimeouts++;
            String ip = expiredValue.left.getHostAddress();
            AtomicLong c = timeoutsPerHost.get(ip);
            if (c == null)
            {
                c = new AtomicLong();
                timeoutsPerHost.put(ip, c);
            }
            c.incrementAndGet();
            // we only create AtomicLong instances here, so that the write
            // access to the hashmap happens single-threadedly.
            if (recentTimeoutsPerHost.get(ip) == null)
                recentTimeoutsPerHost.put(ip, new AtomicLong());

            return null;
        }
    };
    callbacks = new ExpiringMap<String, Pair<InetAddress, IMessageCallback>>(DEFAULT_CALLBACK_TIMEOUT, timeoutReporter);

    MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
    try
    {
        mbs.registerMBean(this, new ObjectName(MBEAN_NAME));
    }
    catch (Exception e)
    {
        throw new RuntimeException(e);
    }
}
 
开发者ID:devdattakulkarni,项目名称:Cassandra-KVPM,代码行数:57,代码来源:MessagingService.java



注:本文中的org.apache.cassandra.concurrent.DebuggableThreadPoolExecutor类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java DatabaseTearDown类代码示例发布时间:2022-05-22
下一篇:
Java XMPPErrorException类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap