Java Code Examples for org.apache.hadoop.fs.azure.NativeAzureFileSystem

The following examples show how to use org.apache.hadoop.fs.azure.NativeAzureFileSystem. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: flink   Source File: AbstractAzureFSFactory.java    License: Apache License 2.0 5 votes vote down vote up
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;
}
 
Example 2
@Test
public void testMetricsSourceNames() {
  String name1 = NativeAzureFileSystem.newMetricsSourceName();
  String name2 = NativeAzureFileSystem.newMetricsSourceName();
  assertTrue(name1.startsWith("AzureFileSystemMetrics"));
  assertTrue(name2.startsWith("AzureFileSystemMetrics"));
  assertTrue(!name1.equals(name2));
}
 
Example 3
@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));
}
 
Example 4
@Test
public void testMetricsSourceNames() {
  String name1 = NativeAzureFileSystem.newMetricsSourceName();
  String name2 = NativeAzureFileSystem.newMetricsSourceName();
  assertTrue(name1.startsWith("AzureFileSystemMetrics"));
  assertTrue(name2.startsWith("AzureFileSystemMetrics"));
  assertTrue(!name1.equals(name2));
}
 
Example 5
@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));
}
 
Example 6
Source Project: flink   Source File: AbstractAzureFSFactory.java    License: Apache License 2.0 5 votes vote down vote up
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;
}
 
Example 7
Source Project: hadoop   Source File: TestAzureFileSystemInstrumentation.java    License: Apache License 2.0 4 votes vote down vote up
private BandwidthGaugeUpdater getBandwidthGaugeUpdater() {
  NativeAzureFileSystem azureFs = (NativeAzureFileSystem)fs;
  AzureNativeFileSystemStore azureStore = azureFs.getStore();
  return azureStore.getBandwidthGaugeUpdater();
}
 
Example 8
Source Project: hadoop   Source File: TestAzureFileSystemInstrumentation.java    License: Apache License 2.0 4 votes vote down vote up
private AzureFileSystemInstrumentation getInstrumentation() {
  return ((NativeAzureFileSystem)fs).getInstrumentation();
}
 
Example 9
Source Project: big-c   Source File: TestAzureFileSystemInstrumentation.java    License: Apache License 2.0 4 votes vote down vote up
private BandwidthGaugeUpdater getBandwidthGaugeUpdater() {
  NativeAzureFileSystem azureFs = (NativeAzureFileSystem)fs;
  AzureNativeFileSystemStore azureStore = azureFs.getStore();
  return azureStore.getBandwidthGaugeUpdater();
}
 
Example 10
Source Project: big-c   Source File: TestAzureFileSystemInstrumentation.java    License: Apache License 2.0 4 votes vote down vote up
private AzureFileSystemInstrumentation getInstrumentation() {
  return ((NativeAzureFileSystem)fs).getInstrumentation();
}