Java 类org.apache.hadoop.fs.azure.AzureBlobStorageTestAccount 实例源码

项目:hadoop    文件:TestNativeAzureFileSystemMetricsSystem.java   
/**
 * Tests that when we have multiple file systems created/destroyed 
 * metrics from each are published correctly.
 * @throws Exception 
 */
@Test
public void testMetricsAcrossFileSystems()
    throws Exception {
  AzureBlobStorageTestAccount a1, a2, a3;

  a1 = AzureBlobStorageTestAccount.createMock();
  assertEquals(0, getFilesCreated(a1));
  a2 = AzureBlobStorageTestAccount.createMock();
  assertEquals(0, getFilesCreated(a2));
  a1.getFileSystem().create(new Path("/foo")).close();
  a1.getFileSystem().create(new Path("/bar")).close();
  a2.getFileSystem().create(new Path("/baz")).close();
  assertEquals(0, getFilesCreated(a1));
  assertEquals(0, getFilesCreated(a2));
  a1.closeFileSystem(); // Causes the file system to close, which publishes metrics
  a2.closeFileSystem();

  assertEquals(2, getFilesCreated(a1));
  assertEquals(1, getFilesCreated(a2));
  a3 = AzureBlobStorageTestAccount.createMock();
  assertEquals(0, getFilesCreated(a3));
  a3.closeFileSystem();
  assertEquals(0, getFilesCreated(a3));
}
项目:aliyun-oss-hadoop-fs    文件:TestNativeAzureFileSystemMetricsSystem.java   
/**
 * Tests that when we have multiple file systems created/destroyed 
 * metrics from each are published correctly.
 * @throws Exception 
 */
@Test
public void testMetricsAcrossFileSystems()
    throws Exception {
  AzureBlobStorageTestAccount a1, a2, a3;

  a1 = AzureBlobStorageTestAccount.createMock();
  assertEquals(0, getFilesCreated(a1));
  a2 = AzureBlobStorageTestAccount.createMock();
  assertEquals(0, getFilesCreated(a2));
  a1.getFileSystem().create(new Path("/foo")).close();
  a1.getFileSystem().create(new Path("/bar")).close();
  a2.getFileSystem().create(new Path("/baz")).close();
  assertEquals(0, getFilesCreated(a1));
  assertEquals(0, getFilesCreated(a2));
  a1.closeFileSystem(); // Causes the file system to close, which publishes metrics
  a2.closeFileSystem();

  assertEquals(2, getFilesCreated(a1));
  assertEquals(1, getFilesCreated(a2));
  a3 = AzureBlobStorageTestAccount.createMock();
  assertEquals(0, getFilesCreated(a3));
  a3.closeFileSystem();
  assertEquals(0, getFilesCreated(a3));
}
项目:big-c    文件:TestNativeAzureFileSystemMetricsSystem.java   
/**
 * Tests that when we have multiple file systems created/destroyed 
 * metrics from each are published correctly.
 * @throws Exception 
 */
@Test
public void testMetricsAcrossFileSystems()
    throws Exception {
  AzureBlobStorageTestAccount a1, a2, a3;

  a1 = AzureBlobStorageTestAccount.createMock();
  assertEquals(0, getFilesCreated(a1));
  a2 = AzureBlobStorageTestAccount.createMock();
  assertEquals(0, getFilesCreated(a2));
  a1.getFileSystem().create(new Path("/foo")).close();
  a1.getFileSystem().create(new Path("/bar")).close();
  a2.getFileSystem().create(new Path("/baz")).close();
  assertEquals(0, getFilesCreated(a1));
  assertEquals(0, getFilesCreated(a2));
  a1.closeFileSystem(); // Causes the file system to close, which publishes metrics
  a2.closeFileSystem();

  assertEquals(2, getFilesCreated(a1));
  assertEquals(1, getFilesCreated(a2));
  a3 = AzureBlobStorageTestAccount.createMock();
  assertEquals(0, getFilesCreated(a3));
  a3.closeFileSystem();
  assertEquals(0, getFilesCreated(a3));
}
项目:hadoop-2.6.0-cdh5.4.3    文件:TestNativeAzureFileSystemMetricsSystem.java   
/**
 * Tests that when we have multiple file systems created/destroyed 
 * metrics from each are published correctly.
 * @throws Exception 
 */
@Test
public void testMetricsAcrossFileSystems()
    throws Exception {
  AzureBlobStorageTestAccount a1, a2, a3;

  a1 = AzureBlobStorageTestAccount.createMock();
  assertEquals(0, getFilesCreated(a1));
  a2 = AzureBlobStorageTestAccount.createMock();
  assertEquals(0, getFilesCreated(a2));
  a1.getFileSystem().create(new Path("/foo")).close();
  a1.getFileSystem().create(new Path("/bar")).close();
  a2.getFileSystem().create(new Path("/baz")).close();
  assertEquals(0, getFilesCreated(a1));
  assertEquals(0, getFilesCreated(a2));
  a1.closeFileSystem(); // Causes the file system to close, which publishes metrics
  a2.closeFileSystem();

  assertEquals(2, getFilesCreated(a1));
  assertEquals(1, getFilesCreated(a2));
  a3 = AzureBlobStorageTestAccount.createMock();
  assertEquals(0, getFilesCreated(a3));
  a3.closeFileSystem();
  assertEquals(0, getFilesCreated(a3));
}
项目:hadoop    文件:TestNativeAzureFileSystemMetricsSystem.java   
@Test
public void testSkipMetricsCollection() throws Exception {
  AzureBlobStorageTestAccount a;
  a = AzureBlobStorageTestAccount.createMock();
  a.getFileSystem().getConf().setBoolean(
    NativeAzureFileSystem.SKIP_AZURE_METRICS_PROPERTY_NAME, true);
  a.getFileSystem().create(new Path("/foo")).close();
  a.closeFileSystem(); // Causes the file system to close, which publishes metrics
  assertEquals(0, getFilesCreated(a));
}
项目:hadoop    文件:TestAzureFileSystemInstrumentation.java   
@Before
public void setUp() throws Exception {
  testAccount = AzureBlobStorageTestAccount.create();
  if (testAccount != null) {
    fs = testAccount.getFileSystem();
  }
  assumeNotNull(testAccount);
}
项目:aliyun-oss-hadoop-fs    文件:TestNativeAzureFileSystemMetricsSystem.java   
@Test
public void testSkipMetricsCollection() throws Exception {
  AzureBlobStorageTestAccount a;
  a = AzureBlobStorageTestAccount.createMock();
  a.getFileSystem().getConf().setBoolean(
    NativeAzureFileSystem.SKIP_AZURE_METRICS_PROPERTY_NAME, true);
  a.getFileSystem().create(new Path("/foo")).close();
  a.closeFileSystem(); // Causes the file system to close, which publishes metrics
  assertEquals(0, getFilesCreated(a));
}
项目:aliyun-oss-hadoop-fs    文件:TestAzureFileSystemInstrumentation.java   
@Before
public void setUp() throws Exception {
  testAccount = AzureBlobStorageTestAccount.create();
  if (testAccount != null) {
    fs = testAccount.getFileSystem();
  }
  assumeNotNull(testAccount);
}
项目:big-c    文件:TestNativeAzureFileSystemMetricsSystem.java   
@Test
public void testSkipMetricsCollection() throws Exception {
  AzureBlobStorageTestAccount a;
  a = AzureBlobStorageTestAccount.createMock();
  a.getFileSystem().getConf().setBoolean(
    NativeAzureFileSystem.SKIP_AZURE_METRICS_PROPERTY_NAME, true);
  a.getFileSystem().create(new Path("/foo")).close();
  a.closeFileSystem(); // Causes the file system to close, which publishes metrics
  assertEquals(0, getFilesCreated(a));
}
项目:big-c    文件:TestAzureFileSystemInstrumentation.java   
@Before
public void setUp() throws Exception {
  testAccount = AzureBlobStorageTestAccount.create();
  if (testAccount != null) {
    fs = testAccount.getFileSystem();
  }
  assumeNotNull(testAccount);
}
项目:hadoop-2.6.0-cdh5.4.3    文件:TestAzureFileSystemInstrumentation.java   
@Before
public void setUp() throws Exception {
  testAccount = AzureBlobStorageTestAccount.create();
  if (testAccount != null) {
    fs = testAccount.getFileSystem();
  }
  assumeNotNull(testAccount);
}
项目:hadoop    文件:TestNativeAzureFileSystemMetricsSystem.java   
private static int getFilesCreated(AzureBlobStorageTestAccount testAccount) {
  return testAccount.getLatestMetricValue(WASB_FILES_CREATED, 0).intValue();    
}
项目:aliyun-oss-hadoop-fs    文件:TestNativeAzureFileSystemMetricsSystem.java   
private static int getFilesCreated(AzureBlobStorageTestAccount testAccount) {
  return testAccount.getLatestMetricValue(WASB_FILES_CREATED, 0).intValue();    
}
项目:big-c    文件:TestNativeAzureFileSystemMetricsSystem.java   
private static int getFilesCreated(AzureBlobStorageTestAccount testAccount) {
  return testAccount.getLatestMetricValue(WASB_FILES_CREATED, 0).intValue();    
}
项目:hadoop-2.6.0-cdh5.4.3    文件:TestNativeAzureFileSystemMetricsSystem.java   
private static int getFilesCreated(AzureBlobStorageTestAccount testAccount) {
  return testAccount.getLatestMetricValue(WASB_FILES_CREATED, 0).intValue();    
}