本文整理汇总了Java中org.apache.cassandra.config.DatabaseDescriptor.setStreamThroughputOutboundMegabitsPerSec方法的典型用法代码示例。如果您正苦于以下问题:Java DatabaseDescriptor.setStreamThroughputOutboundMegabitsPerSec方法的具体用法?Java DatabaseDescriptor.setStreamThroughputOutboundMegabitsPerSec怎么用?Java DatabaseDescriptor.setStreamThroughputOutboundMegabitsPerSec使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.cassandra.config.DatabaseDescriptor
的用法示例。
在下文中一共展示了DatabaseDescriptor.setStreamThroughputOutboundMegabitsPerSec方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: main
import org.apache.cassandra.config.DatabaseDescriptor; //导入方法依赖的package包/类
public static void main(String args[])
{
LoaderOptions options = LoaderOptions.parseArgs(args);
OutputHandler handler = new OutputHandler.SystemOutput(options.verbose, options.debug);
SSTableLoader loader = new SSTableLoader(options.directory, new ExternalClient(options.hosts, options.rpcPort, options.user, options.passwd), handler);
DatabaseDescriptor.setStreamThroughputOutboundMegabitsPerSec(options.throttle);
StreamResultFuture future = loader.stream(options.ignores);
future.addEventListener(new ProgressIndicator());
try
{
future.get();
System.exit(0); // We need that to stop non daemonized threads
}
catch (Exception e)
{
System.err.println("Streaming to the following hosts failed:");
System.err.println(loader.getFailedHosts());
System.err.println(e);
if (options.debug)
e.printStackTrace(System.err);
System.exit(1);
}
}
示例2: AbstractBulkRecordWriter
import org.apache.cassandra.config.DatabaseDescriptor; //导入方法依赖的package包/类
protected AbstractBulkRecordWriter(Configuration conf)
{
Config.setClientMode(true);
Config.setOutboundBindAny(true);
this.conf = conf;
DatabaseDescriptor.setStreamThroughputOutboundMegabitsPerSec(Integer.parseInt(conf.get(STREAM_THROTTLE_MBITS, "0")));
maxFailures = Integer.parseInt(conf.get(MAX_FAILED_HOSTS, "0"));
bufferSize = Integer.parseInt(conf.get(BUFFER_SIZE_IN_MB, "64"));
}
示例3: BulkRecordWriter
import org.apache.cassandra.config.DatabaseDescriptor; //导入方法依赖的package包/类
BulkRecordWriter(Configuration conf)
{
Config.setClientMode(true);
Config.setOutboundBindAny(true);
this.conf = conf;
DatabaseDescriptor.setStreamThroughputOutboundMegabitsPerSec(Integer.parseInt(conf.get(STREAM_THROTTLE_MBITS, "0")));
maxFailures = Integer.parseInt(conf.get(MAX_FAILED_HOSTS, "0"));
}
示例4: CqlBulkRecordWriter
import org.apache.cassandra.config.DatabaseDescriptor; //导入方法依赖的package包/类
CqlBulkRecordWriter(Configuration conf) throws IOException
{
Config.setOutboundBindAny(true);
this.conf = conf;
DatabaseDescriptor.setStreamThroughputOutboundMegabitsPerSec(Integer.parseInt(conf.get(STREAM_THROTTLE_MBITS, "0")));
maxFailures = Integer.parseInt(conf.get(MAX_FAILED_HOSTS, "0"));
bufferSize = Integer.parseInt(conf.get(BUFFER_SIZE_IN_MB, "64"));
setConfigs();
}
示例5: setStreamThroughputMbPerSec
import org.apache.cassandra.config.DatabaseDescriptor; //导入方法依赖的package包/类
public void setStreamThroughputMbPerSec(int value)
{
DatabaseDescriptor.setStreamThroughputOutboundMegabitsPerSec(value);
logger.info("setstreamthroughput: throttle set to {}", value);
}