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

Java ValueQueue类代码示例

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

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



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

示例1: testWarmUp

import org.apache.hadoop.crypto.key.kms.ValueQueue; //导入依赖的package包/类
/**
 * Verifies that Queue is initialized (Warmed-up) for provided keys
 */
@Test(timeout=30000)
public void testWarmUp() throws Exception {
  MockFiller filler = new MockFiller();
  ValueQueue<String> vq =
      new ValueQueue<String>(10, 0.5f, 300, 1,
          SyncGenerationPolicy.ALL, filler);
  vq.initializeQueuesForKeys("k1", "k2", "k3");
  FillInfo[] fillInfos =
    {filler.getTop(), filler.getTop(), filler.getTop()};
  Assert.assertEquals(5, fillInfos[0].num);
  Assert.assertEquals(5, fillInfos[1].num);
  Assert.assertEquals(5, fillInfos[2].num);
  Assert.assertEquals(Sets.newHashSet("k1", "k2", "k3"),
      Sets.newHashSet(fillInfos[0].key,
          fillInfos[1].key,
          fillInfos[2].key));
  vq.shutdown();
}
 
开发者ID:nucypher,项目名称:hadoop-oss,代码行数:22,代码来源:TestValueQueue.java


示例2: testgetAtMostPolicyLOW_WATERMARK

import org.apache.hadoop.crypto.key.kms.ValueQueue; //导入依赖的package包/类
/**
 * Verify getAtMost when SyncGeneration Policy = LOW_WATERMARK
 */
@Test(timeout=30000)
public void testgetAtMostPolicyLOW_WATERMARK() throws Exception {
  MockFiller filler = new MockFiller();
  ValueQueue<String> vq =
      new ValueQueue<String>(10, 0.3f, 300, 1,
          SyncGenerationPolicy.LOW_WATERMARK, filler);
  Assert.assertEquals("test", vq.getNext("k1"));
  Assert.assertEquals(3, filler.getTop().num);
  // Drain completely
  Assert.assertEquals(3, vq.getAtMost("k1", 10).size());
  // Synchronous call
  Assert.assertEquals(1, filler.getTop().num);
  // Asynch Refill call
  Assert.assertEquals(10, filler.getTop().num);
  vq.shutdown();
}
 
开发者ID:nucypher,项目名称:hadoop-oss,代码行数:20,代码来源:TestValueQueue.java


示例3: CryptoExtension

import org.apache.hadoop.crypto.key.kms.ValueQueue; //导入依赖的package包/类
public CryptoExtension(Configuration conf, 
    KeyProviderCryptoExtension keyProviderCryptoExtension) {
  this.keyProviderCryptoExtension = keyProviderCryptoExtension;
  encKeyVersionQueue =
      new ValueQueue<KeyProviderCryptoExtension.EncryptedKeyVersion>(
          conf.getInt(KMS_KEY_CACHE_SIZE,
              KMS_KEY_CACHE_SIZE_DEFAULT),
          conf.getFloat(KMS_KEY_CACHE_LOW_WATERMARK,
              KMS_KEY_CACHE_LOW_WATERMARK_DEFAULT),
          conf.getInt(KMS_KEY_CACHE_EXPIRY_MS,
              KMS_KEY_CACHE_EXPIRY_DEFAULT),
          conf.getInt(KMS_KEY_CACHE_NUM_REFILL_THREADS,
              KMS_KEY_CACHE_NUM_REFILL_THREADS_DEFAULT),
          SyncGenerationPolicy.LOW_WATERMARK, new EncryptedQueueRefiller()
      );
}
 
开发者ID:nucypher,项目名称:hadoop-oss,代码行数:17,代码来源:EagerKeyGeneratorKeyProviderCryptoExtension.java


示例4: testWarmUp

import org.apache.hadoop.crypto.key.kms.ValueQueue; //导入依赖的package包/类
/**
 * Verifies that Queue is initialized (Warmed-up) for provided keys
 */
@Test
public void testWarmUp() throws Exception {
  MockFiller filler = new MockFiller();
  ValueQueue<String> vq =
      new ValueQueue<String>(10, 0.5f, 300, 1,
          SyncGenerationPolicy.ALL, filler);
  vq.initializeQueuesForKeys("k1", "k2", "k3");
  FillInfo[] fillInfos =
    {filler.getTop(), filler.getTop(), filler.getTop()};
  Assert.assertEquals(5, fillInfos[0].num);
  Assert.assertEquals(5, fillInfos[1].num);
  Assert.assertEquals(5, fillInfos[2].num);
  Assert.assertEquals(Sets.newHashSet("k1", "k2", "k3"),
      Sets.newHashSet(fillInfos[0].key,
          fillInfos[1].key,
          fillInfos[2].key));
  vq.shutdown();
}
 
开发者ID:naver,项目名称:hadoop,代码行数:22,代码来源:TestValueQueue.java


示例5: testgetAtMostPolicyALL

import org.apache.hadoop.crypto.key.kms.ValueQueue; //导入依赖的package包/类
/**
 * Verify getAtMost when SyncGeneration Policy = ALL
 */
@Test
public void testgetAtMostPolicyALL() throws Exception {
  MockFiller filler = new MockFiller();
  ValueQueue<String> vq =
      new ValueQueue<String>(10, 0.1f, 300, 1,
          SyncGenerationPolicy.ALL, filler);
  Assert.assertEquals("test", vq.getNext("k1"));
  Assert.assertEquals(1, filler.getTop().num);
  // Drain completely
  Assert.assertEquals(10, vq.getAtMost("k1", 10).size());
  // Synchronous call
  Assert.assertEquals(10, filler.getTop().num);
  // Ask for more... return all
  Assert.assertEquals(19, vq.getAtMost("k1", 19).size());
  // Synchronous call (No Async call since num > lowWatermark)
  Assert.assertEquals(19, filler.getTop().num);
  vq.shutdown();
}
 
开发者ID:naver,项目名称:hadoop,代码行数:22,代码来源:TestValueQueue.java


示例6: testgetAtMostPolicyLOW_WATERMARK

import org.apache.hadoop.crypto.key.kms.ValueQueue; //导入依赖的package包/类
/**
 * Verify getAtMost when SyncGeneration Policy = LOW_WATERMARK
 */
@Test
public void testgetAtMostPolicyLOW_WATERMARK() throws Exception {
  MockFiller filler = new MockFiller();
  ValueQueue<String> vq =
      new ValueQueue<String>(10, 0.3f, 300, 1,
          SyncGenerationPolicy.LOW_WATERMARK, filler);
  Assert.assertEquals("test", vq.getNext("k1"));
  Assert.assertEquals(3, filler.getTop().num);
  // Drain completely
  Assert.assertEquals(3, vq.getAtMost("k1", 10).size());
  // Synchronous call
  Assert.assertEquals(1, filler.getTop().num);
  // Asynch Refill call
  Assert.assertEquals(10, filler.getTop().num);
  vq.shutdown();
}
 
开发者ID:naver,项目名称:hadoop,代码行数:20,代码来源:TestValueQueue.java


示例7: CryptoExtension

import org.apache.hadoop.crypto.key.kms.ValueQueue; //导入依赖的package包/类
public CryptoExtension(Configuration conf,
    KeyProviderCryptoExtension keyProviderCryptoExtension) {
  this.keyProviderCryptoExtension = keyProviderCryptoExtension;
  encKeyVersionQueue =
      new ValueQueue<KeyProviderCryptoExtension.EncryptedKeyVersion>(
          conf.getInt(KMS_KEY_CACHE_SIZE,
              KMS_KEY_CACHE_SIZE_DEFAULT),
          conf.getFloat(KMS_KEY_CACHE_LOW_WATERMARK,
              KMS_KEY_CACHE_LOW_WATERMARK_DEFAULT),
          conf.getInt(KMS_KEY_CACHE_EXPIRY_MS,
              KMS_KEY_CACHE_EXPIRY_DEFAULT),
          conf.getInt(KMS_KEY_CACHE_NUM_REFILL_THREADS,
              KMS_KEY_CACHE_NUM_REFILL_THREADS_DEFAULT),
          SyncGenerationPolicy.LOW_WATERMARK, new EncryptedQueueRefiller()
      );
}
 
开发者ID:naver,项目名称:hadoop,代码行数:17,代码来源:EagerKeyGeneratorKeyProviderCryptoExtension.java


示例8: testInitFill

import org.apache.hadoop.crypto.key.kms.ValueQueue; //导入依赖的package包/类
/**
 * Verifies that Queue is initially filled to "numInitValues"
 */
@Test(timeout=30000)
public void testInitFill() throws Exception {
  MockFiller filler = new MockFiller();
  ValueQueue<String> vq =
      new ValueQueue<String>(10, 0.1f, 300, 1,
          SyncGenerationPolicy.ALL, filler);
  Assert.assertEquals("test", vq.getNext("k1"));
  Assert.assertEquals(1, filler.getTop().num);
  vq.shutdown();
}
 
开发者ID:nucypher,项目名称:hadoop-oss,代码行数:14,代码来源:TestValueQueue.java


示例9: testRefill

import org.apache.hadoop.crypto.key.kms.ValueQueue; //导入依赖的package包/类
/**
 * Verifies that the refill task is executed after "checkInterval" if
 * num values below "lowWatermark"
 */
@Test(timeout=30000)
public void testRefill() throws Exception {
  MockFiller filler = new MockFiller();
  ValueQueue<String> vq =
      new ValueQueue<String>(10, 0.1f, 300, 1,
          SyncGenerationPolicy.ALL, filler);
  Assert.assertEquals("test", vq.getNext("k1"));
  Assert.assertEquals(1, filler.getTop().num);
  // Trigger refill
  vq.getNext("k1");
  Assert.assertEquals(1, filler.getTop().num);
  Assert.assertEquals(10, filler.getTop().num);
  vq.shutdown();
}
 
开发者ID:nucypher,项目名称:hadoop-oss,代码行数:19,代码来源:TestValueQueue.java


示例10: testNoRefill

import org.apache.hadoop.crypto.key.kms.ValueQueue; //导入依赖的package包/类
/**
 * Verifies that the No refill Happens after "checkInterval" if
 * num values above "lowWatermark"
 */
@Test(timeout=30000)
public void testNoRefill() throws Exception {
  MockFiller filler = new MockFiller();
  ValueQueue<String> vq =
      new ValueQueue<String>(10, 0.5f, 300, 1,
          SyncGenerationPolicy.ALL, filler);
  Assert.assertEquals("test", vq.getNext("k1"));
  Assert.assertEquals(5, filler.getTop().num);
  Assert.assertEquals(null, filler.getTop());
  vq.shutdown();
}
 
开发者ID:nucypher,项目名称:hadoop-oss,代码行数:16,代码来源:TestValueQueue.java


示例11: testgetAtMostPolicyATLEAST_ONE

import org.apache.hadoop.crypto.key.kms.ValueQueue; //导入依赖的package包/类
/**
 * Verify getAtMost when SyncGeneration Policy = ALL
 */
@Test(timeout=30000)
public void testgetAtMostPolicyATLEAST_ONE() throws Exception {
  MockFiller filler = new MockFiller();
  ValueQueue<String> vq =
      new ValueQueue<String>(10, 0.3f, 300, 1,
          SyncGenerationPolicy.ATLEAST_ONE, filler);
  Assert.assertEquals("test", vq.getNext("k1"));
  Assert.assertEquals(3, filler.getTop().num);
  // Drain completely
  Assert.assertEquals(2, vq.getAtMost("k1", 10).size());
  // Asynch Refill call
  Assert.assertEquals(10, filler.getTop().num);
  vq.shutdown();
}
 
开发者ID:nucypher,项目名称:hadoop-oss,代码行数:18,代码来源:TestValueQueue.java


示例12: testDrain

import org.apache.hadoop.crypto.key.kms.ValueQueue; //导入依赖的package包/类
@Test(timeout=30000)
public void testDrain() throws Exception {
  MockFiller filler = new MockFiller();
  ValueQueue<String> vq =
      new ValueQueue<String>(10, 0.1f, 300, 1,
          SyncGenerationPolicy.ALL, filler);
  Assert.assertEquals("test", vq.getNext("k1"));
  Assert.assertEquals(1, filler.getTop().num);
  vq.drain("k1");
  Assert.assertNull(filler.getTop());
  vq.shutdown();
}
 
开发者ID:nucypher,项目名称:hadoop-oss,代码行数:13,代码来源:TestValueQueue.java


示例13: testInitFill

import org.apache.hadoop.crypto.key.kms.ValueQueue; //导入依赖的package包/类
/**
 * Verifies that Queue is initially filled to "numInitValues"
 */
@Test
public void testInitFill() throws Exception {
  MockFiller filler = new MockFiller();
  ValueQueue<String> vq =
      new ValueQueue<String>(10, 0.1f, 300, 1,
          SyncGenerationPolicy.ALL, filler);
  Assert.assertEquals("test", vq.getNext("k1"));
  Assert.assertEquals(1, filler.getTop().num);
  vq.shutdown();
}
 
开发者ID:naver,项目名称:hadoop,代码行数:14,代码来源:TestValueQueue.java


示例14: testRefill

import org.apache.hadoop.crypto.key.kms.ValueQueue; //导入依赖的package包/类
/**
 * Verifies that the refill task is executed after "checkInterval" if
 * num values below "lowWatermark"
 */
@Test
public void testRefill() throws Exception {
  MockFiller filler = new MockFiller();
  ValueQueue<String> vq =
      new ValueQueue<String>(10, 0.1f, 300, 1,
          SyncGenerationPolicy.ALL, filler);
  Assert.assertEquals("test", vq.getNext("k1"));
  Assert.assertEquals(1, filler.getTop().num);
  // Trigger refill
  vq.getNext("k1");
  Assert.assertEquals(1, filler.getTop().num);
  Assert.assertEquals(10, filler.getTop().num);
  vq.shutdown();
}
 
开发者ID:naver,项目名称:hadoop,代码行数:19,代码来源:TestValueQueue.java


示例15: testNoRefill

import org.apache.hadoop.crypto.key.kms.ValueQueue; //导入依赖的package包/类
/**
 * Verifies that the No refill Happens after "checkInterval" if
 * num values above "lowWatermark"
 */
@Test
public void testNoRefill() throws Exception {
  MockFiller filler = new MockFiller();
  ValueQueue<String> vq =
      new ValueQueue<String>(10, 0.5f, 300, 1,
          SyncGenerationPolicy.ALL, filler);
  Assert.assertEquals("test", vq.getNext("k1"));
  Assert.assertEquals(5, filler.getTop().num);
  Assert.assertEquals(null, filler.getTop());
  vq.shutdown();
}
 
开发者ID:naver,项目名称:hadoop,代码行数:16,代码来源:TestValueQueue.java


示例16: testgetAtMostPolicyATLEAST_ONE

import org.apache.hadoop.crypto.key.kms.ValueQueue; //导入依赖的package包/类
/**
 * Verify getAtMost when SyncGeneration Policy = ALL
 */
@Test
public void testgetAtMostPolicyATLEAST_ONE() throws Exception {
  MockFiller filler = new MockFiller();
  ValueQueue<String> vq =
      new ValueQueue<String>(10, 0.3f, 300, 1,
          SyncGenerationPolicy.ATLEAST_ONE, filler);
  Assert.assertEquals("test", vq.getNext("k1"));
  Assert.assertEquals(3, filler.getTop().num);
  // Drain completely
  Assert.assertEquals(2, vq.getAtMost("k1", 10).size());
  // Asynch Refill call
  Assert.assertEquals(10, filler.getTop().num);
  vq.shutdown();
}
 
开发者ID:naver,项目名称:hadoop,代码行数:18,代码来源:TestValueQueue.java


示例17: testDrain

import org.apache.hadoop.crypto.key.kms.ValueQueue; //导入依赖的package包/类
@Test
public void testDrain() throws Exception {
  MockFiller filler = new MockFiller();
  ValueQueue<String> vq =
      new ValueQueue<String>(10, 0.1f, 300, 1,
          SyncGenerationPolicy.ALL, filler);
  Assert.assertEquals("test", vq.getNext("k1"));
  Assert.assertEquals(1, filler.getTop().num);
  vq.drain("k1");
  Assert.assertNull(filler.getTop());
  vq.shutdown();
}
 
开发者ID:naver,项目名称:hadoop,代码行数:13,代码来源:TestValueQueue.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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