类org.apache.hadoop.fs.azure.NativeAzureFileSystem源码实例Demo

下面列出了怎么用org.apache.hadoop.fs.azure.NativeAzureFileSystem的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: flink   文件: AbstractAzureFSFactory.java
private org.apache.hadoop.fs.FileSystem createInitializedAzureFS(URI fsUri, Configuration flinkConfig) throws IOException {
	org.apache.hadoop.conf.Configuration hadoopConfig = configLoader.getOrLoadHadoopConfig();

	org.apache.hadoop.fs.FileSystem azureFS = new NativeAzureFileSystem();
	azureFS.initialize(fsUri, hadoopConfig);

	return azureFS;
}
 
@Test
public void testMetricsSourceNames() {
  String name1 = NativeAzureFileSystem.newMetricsSourceName();
  String name2 = NativeAzureFileSystem.newMetricsSourceName();
  assertTrue(name1.startsWith("AzureFileSystemMetrics"));
  assertTrue(name2.startsWith("AzureFileSystemMetrics"));
  assertTrue(!name1.equals(name2));
}
 
@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));
}
 
@Test
public void testMetricsSourceNames() {
  String name1 = NativeAzureFileSystem.newMetricsSourceName();
  String name2 = NativeAzureFileSystem.newMetricsSourceName();
  assertTrue(name1.startsWith("AzureFileSystemMetrics"));
  assertTrue(name2.startsWith("AzureFileSystemMetrics"));
  assertTrue(!name1.equals(name2));
}
 
@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));
}
 
源代码6 项目: flink   文件: AbstractAzureFSFactory.java
private org.apache.hadoop.fs.FileSystem createInitializedAzureFS(URI fsUri, Configuration flinkConfig) throws IOException {
	org.apache.hadoop.conf.Configuration hadoopConfig = configLoader.getOrLoadHadoopConfig();

	org.apache.hadoop.fs.FileSystem azureFS = new NativeAzureFileSystem();
	azureFS.initialize(fsUri, hadoopConfig);

	return azureFS;
}
 
private BandwidthGaugeUpdater getBandwidthGaugeUpdater() {
  NativeAzureFileSystem azureFs = (NativeAzureFileSystem)fs;
  AzureNativeFileSystemStore azureStore = azureFs.getStore();
  return azureStore.getBandwidthGaugeUpdater();
}
 
private AzureFileSystemInstrumentation getInstrumentation() {
  return ((NativeAzureFileSystem)fs).getInstrumentation();
}
 
private BandwidthGaugeUpdater getBandwidthGaugeUpdater() {
  NativeAzureFileSystem azureFs = (NativeAzureFileSystem)fs;
  AzureNativeFileSystemStore azureStore = azureFs.getStore();
  return azureStore.getBandwidthGaugeUpdater();
}
 
源代码10 项目: big-c   文件: TestAzureFileSystemInstrumentation.java
private AzureFileSystemInstrumentation getInstrumentation() {
  return ((NativeAzureFileSystem)fs).getInstrumentation();
}
 
 类所在包
 类方法
 同包方法