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

The following examples show how to use org.apache.hadoop.fs.azure.NativeAzureFileSystem. 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 File: AbstractAzureFSFactory.java    From flink with 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
Source File: TestNativeAzureFileSystemMetricsSystem.java    From hadoop with Apache License 2.0 5 votes vote down vote up
@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
Source File: TestNativeAzureFileSystemMetricsSystem.java    From hadoop with Apache License 2.0 5 votes vote down vote up
@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
Source File: TestNativeAzureFileSystemMetricsSystem.java    From big-c with Apache License 2.0 5 votes vote down vote up
@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
Source File: TestNativeAzureFileSystemMetricsSystem.java    From big-c with Apache License 2.0 5 votes vote down vote up
@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 File: AbstractAzureFSFactory.java    From flink with 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 File: TestAzureFileSystemInstrumentation.java    From hadoop with 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 File: TestAzureFileSystemInstrumentation.java    From hadoop with Apache License 2.0 4 votes vote down vote up
private AzureFileSystemInstrumentation getInstrumentation() {
  return ((NativeAzureFileSystem)fs).getInstrumentation();
}
 
Example #9
Source File: TestAzureFileSystemInstrumentation.java    From big-c with 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 File: TestAzureFileSystemInstrumentation.java    From big-c with Apache License 2.0 4 votes vote down vote up
private AzureFileSystemInstrumentation getInstrumentation() {
  return ((NativeAzureFileSystem)fs).getInstrumentation();
}