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

Java Size类代码示例

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

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



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

示例1: BackupProcessor

import io.dropwizard.util.Size; //导入依赖的package包/类
public BackupProcessor(DistributedLockManager lockManager, MetadataStorage<BackupMetadata> metadataStorage, FileStorage localStorage, FileStorage offsiteStorage,
                       CodecFactory codecFactory, ExecutorService offsiteUploadWorkers, Size chunkSize,
                       FileStorage logStorage, String nodeName, Set<String> compressedFileExtensions, MetricRegistry metricRegistry,
                       List<BackupProcessorListener> listeners) {
    super (lockManager, metadataStorage, logStorage, nodeName);

    this.localStorage = localStorage;
    this.offsiteStorage = offsiteStorage;
    this.codecFactory = codecFactory;
    this.offsiteUploadWorkers = MoreExecutors.listeningDecorator(offsiteUploadWorkers);
    this.chunkSize = chunkSize;
    this.compressedFileExtensions = compressedFileExtensions;
    this.listeners = listeners;

    ACTIVE_STORES = metricRegistry.counter("active-stores");
    STORE_SIZES = metricRegistry.histogram("store-sizes");
    STORE_TIMES = metricRegistry.timer("store-times");

    ACTIVE_UPLOADS = metricRegistry.counter("active-uploads");
    UPLOAD_SIZES = metricRegistry.histogram("upload-sizes");
    UPLOAD_TIMES = metricRegistry.timer("upload-times");

    ACTIVE_DOWNLOADS = metricRegistry.counter("active-downloads");
    DOWNLOAD_SIZES = metricRegistry.histogram("download-sizes");
    DOWNLOAD_TIMES = metricRegistry.timer("download-times");
}
 
开发者ID:yammer,项目名称:backups,代码行数:27,代码来源:BackupProcessor.java


示例2: testBoundaries

import io.dropwizard.util.Size; //导入依赖的package包/类
@Test
public void testBoundaries() throws IOException {
    final MinebdConfig cfg = new MinebdConfig();

    cfg.bucketSize = Size.bytes(16); //buckets for ants
    cfg.maxOpenFiles = 3;
    cfg.parentDirs = Collections.singletonList("tinyfiles");

    final MineboxExport underTest = buildMineboxExport(cfg);
    final byte[] data = new byte[257];

    for (int i = 0; i < data.length; i++) {
        data[i] = (byte) i;
    }
    Assert.assertEquals(0, data[0]);
    Assert.assertEquals(127, data[127]);
    Assert.assertEquals(-1, data[255]);
    Assert.assertEquals(0, data[256]);


    underTest.write(0, ByteBuffer.wrap(data), false);
    final ByteBuffer read = underTest.read(0, 257);
    Assert.assertEquals
            (0, read.get(0));
    Assert.assertEquals(0, read.get(256));
    Assert.assertEquals(25, read.get(25));


}
 
开发者ID:MineboxOS,项目名称:minebox,代码行数:30,代码来源:MineboxExportTest.java


示例3: createSampleConfig

import io.dropwizard.util.Size; //导入依赖的package包/类
public static MinebdConfig createSampleConfig() {
    final MinebdConfig config = new MinebdConfig();
    config.bucketSize = Size.megabytes(40);
    config.parentDirs = Collections.singletonList("testJunit");
    config.reportedSize = Size.gigabytes(4);
    config.maxOpenFiles = 10;
    return config;
}
 
开发者ID:MineboxOS,项目名称:minebox,代码行数:9,代码来源:TestUtil.java


示例4: build

import io.dropwizard.util.Size; //导入依赖的package包/类
@JsonIgnore
public ChannelFuture build(@Nonnull final Environment environment,
        @Nonnull final Uploader uploader,
        @Nonnull final Size maxUploadSize) {

    final UploadInitializer initializer = new UploadInitializer(this,
            uploader, maxUploadSize.toBytes());

    final EventLoopGroup bossGroup = Netty.newBossEventLoopGroup();
    final EventLoopGroup workerGroup = Netty.newWorkerEventLoopGroup();

    environment.lifecycle().manage(new EventLoopGroupManager(bossGroup));
    environment.lifecycle().manage(new EventLoopGroupManager(workerGroup));

    final ServerBootstrap bootstrap = new ServerBootstrap();

    // Start the server
    final ChannelFuture future = bootstrap.group(bossGroup, workerGroup)
            .handler(new LoggingHandler(LogLevel.INFO))
            .option(ChannelOption.SO_BACKLOG, 128)
            .channel(Netty.serverChannelType())
            .childOption(ChannelOption.SO_KEEPALIVE, true)
            .childHandler(initializer).bind(listenPort);

    environment.lifecycle().manage(new ChannelFutureManager(future));
    return future;
}
 
开发者ID:smoketurner,项目名称:uploader,代码行数:28,代码来源:NettyConfiguration.java


示例5: check

import io.dropwizard.util.Size; //导入依赖的package包/类
@Override
protected Result check() throws IOException {
    final Size freeSpace = storage.getFreeSpace();
    if (freeSpace.toBytes() > minStorage.toBytes()) {
        LOG.trace("Free space {} is greater than threshold {}, skipping", freeSpace, minStorage);
        return Result.healthy();
    }

    LOG.warn("Free space {} is less than threshold {}", freeSpace, minStorage);
    return Result.unhealthy(freeSpace.toString());
}
 
开发者ID:yammer,项目名称:backups,代码行数:12,代码来源:StorageCapacityHealthCheck.java


示例6: getUsedSpace

import io.dropwizard.util.Size; //导入依赖的package包/类
@Override
public Size getUsedSpace() {
    final Size totalSpace = this.getTotalSpace();
    final Size freeSpace = this.getFreeSpace();

    return Size.bytes(totalSpace.toBytes() - freeSpace.toBytes());
}
 
开发者ID:yammer,项目名称:backups,代码行数:8,代码来源:LocalFileStorage.java


示例7: getUsedSpace

import io.dropwizard.util.Size; //导入依赖的package包/类
@Override
public Size getUsedSpace() throws IOException {
    for (int i = 0;i < 2;i++) {
        try {
            return this.getUsedSpace(-i);
        }
        catch (StorageException | IOException e) {
            LOG.debug("Failed to fetch storage space for day offset: " + (-i), e);
        }
    }

    throw new IOException("There is no capacity data available");
}
 
开发者ID:yammer,项目名称:backups,代码行数:14,代码来源:AzureFileStorage.java


示例8: getFreeSpace

import io.dropwizard.util.Size; //导入依赖的package包/类
@Override
public Size getFreeSpace() throws IOException {
    final Size totalSpace = this.getTotalSpace();
    final Size usedSpace = this.getUsedSpace();

    return Size.bytes(totalSpace.toBytes() - usedSpace.toBytes());
}
 
开发者ID:yammer,项目名称:backups,代码行数:8,代码来源:AzureFileStorage.java


示例9: StorageStatus

import io.dropwizard.util.Size; //导入依赖的package包/类
public StorageStatus(Size localCapacity, Size localUsedCapacity, Size localFreeCapacity,
        Size offsiteCapacity, Size offsiteUsedCapacity, Size offsiteFreeCapacity) {
    this.localCapacity = localCapacity;
    this.localUsedCapacity = localUsedCapacity;
    this.localFreeCapacity = localFreeCapacity;
    this.offsiteCapacity = offsiteCapacity;
    this.offsiteUsedCapacity = offsiteUsedCapacity;
    this.offsiteFreeCapacity = offsiteFreeCapacity;
}
 
开发者ID:yammer,项目名称:backups,代码行数:10,代码来源:StorageStatus.java


示例10: getMaxLength

import io.dropwizard.util.Size; //导入依赖的package包/类
@JsonProperty
public Size getMaxLength() {
    return maxLength;
}
 
开发者ID:smoketurner,项目名称:graphiak,代码行数:5,代码来源:NettyConfiguration.java


示例11: setMaxLength

import io.dropwizard.util.Size; //导入依赖的package包/类
@JsonProperty
public void setMaxLength(Size maxLength) {
    this.maxLength = maxLength;
}
 
开发者ID:smoketurner,项目名称:graphiak,代码行数:5,代码来源:NettyConfiguration.java


示例12: getMaxThriftFrameSize

import io.dropwizard.util.Size; //导入依赖的package包/类
@Override
public Optional<Size> getMaxThriftFrameSize() {
    return _maxThriftFrameSize;
}
 
开发者ID:bazaarvoice,项目名称:emodb,代码行数:5,代码来源:CassandraConfiguration.java


示例13: setMaxThriftFrameSize

import io.dropwizard.util.Size; //导入依赖的package包/类
public CassandraConfiguration setMaxThriftFrameSize(Optional<Size> maxThriftFrameSize) {
    _maxThriftFrameSize = maxThriftFrameSize;
    return this;
}
 
开发者ID:bazaarvoice,项目名称:emodb,代码行数:5,代码来源:CassandraConfiguration.java


示例14: setMaxThriftFrameSize

import io.dropwizard.util.Size; //导入依赖的package包/类
public KeyspaceConfiguration setMaxThriftFrameSize(Optional<Size> maxThriftFrameSize) {
    _maxThriftFrameSize = maxThriftFrameSize;
    return this;
}
 
开发者ID:bazaarvoice,项目名称:emodb,代码行数:5,代码来源:KeyspaceConfiguration.java


示例15: getMaxThriftFrameSize

import io.dropwizard.util.Size; //导入依赖的package包/类
@Override
public Optional<Size> getMaxThriftFrameSize() {
    return _maxThriftFrameSize.or(_config.getMaxThriftFrameSize());
}
 
开发者ID:bazaarvoice,项目名称:emodb,代码行数:5,代码来源:FilterConnectionPoolConfiguration.java


示例16: setMaxThriftFrameSize

import io.dropwizard.util.Size; //导入依赖的package包/类
public void setMaxThriftFrameSize(Size maxThriftFrameSize) {
    _maxThriftFrameSize = Optional.of(maxThriftFrameSize);
}
 
开发者ID:bazaarvoice,项目名称:emodb,代码行数:4,代码来源:FilterConnectionPoolConfiguration.java


示例17: getMaxUploadSize

import io.dropwizard.util.Size; //导入依赖的package包/类
@JsonProperty
public Size getMaxUploadSize() {
    return maxUploadSize;
}
 
开发者ID:smoketurner,项目名称:uploader,代码行数:5,代码来源:AwsConfiguration.java


示例18: setMaxUploadSize

import io.dropwizard.util.Size; //导入依赖的package包/类
@JsonProperty
public void setMaxUploadSize(Size size) {
    this.maxUploadSize = size;
}
 
开发者ID:smoketurner,项目名称:uploader,代码行数:5,代码来源:AwsConfiguration.java


示例19: getMinimumUploadPartSize

import io.dropwizard.util.Size; //导入依赖的package包/类
@JsonProperty
public Size getMinimumUploadPartSize() {
    return minimumUploadPartSize;
}
 
开发者ID:smoketurner,项目名称:uploader,代码行数:5,代码来源:AwsConfiguration.java


示例20: setMinimumUploadPartSize

import io.dropwizard.util.Size; //导入依赖的package包/类
@JsonProperty
public void setMinimumUploadPartSize(Size size) {
    this.minimumUploadPartSize = size;
}
 
开发者ID:smoketurner,项目名称:uploader,代码行数:5,代码来源:AwsConfiguration.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Java EvaluationContext类代码示例发布时间:2022-05-22
下一篇:
Java FaceppParseException类代码示例发布时间: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