当前位置: 首页>>代码示例>>Java>>正文


Java FsShell类代码示例

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


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

示例1: setup

import org.springframework.data.hadoop.fs.FsShell; //导入依赖的package包/类
@Before
public void setup() {
	this.testDir=System.getProperty("java.io.tmpdir") + "/hdfs-sink";
	String[] env = {"server.port:0",
			"spring.hadoop.fsUri=file:///",
			"hdfs.directory=" + this.testDir,
			"hdfs.closeTimeout=100"};
	EnvironmentTestUtils.addEnvironment(this.context, env);
	this.context.register(HdfsSinkApplication.class);
	this.context.refresh();
	this.fsShell = context.getBean(FsShell.class);
	this.sink = context.getBean(Sink.class);
	if (fsShell.test(testDir)) {
		fsShell.rmr(testDir);
	}
}
 
开发者ID:spring-cloud-stream-app-starters,项目名称:hdfs,代码行数:17,代码来源:HdfsSinkConfigurationTests.java

示例2: setup

import org.springframework.data.hadoop.fs.FsShell; //导入依赖的package包/类
@Before
public void setup() throws IOException {
	this.testDir=System.getProperty("java.io.tmpdir") + "/dataset";
	this.nameSpace = "test";
	String[] env = {"server.port:0",
			"spring.hadoop.fsUri=file:///",
			"hdfs.dataset.directory=" + this.testDir,
			"hdfs.dataset.namespace=" + this.nameSpace,
			"hdfs.dataset.batchSize=2",
			"hdfs.dataset.idleTimeout=2000"};
	EnvironmentTestUtils.addEnvironment(this.context, env);
	this.context.register(HdfsDatasetSinkApplication.class);
	this.context.refresh();
	this.datasetName = context.getBean(DatasetOperations.class).getDatasetName(String.class);
	this.hadoopConfiguration = context.getBean(Configuration.class);
	this.sink = context.getBean(Sink.class);
	FileSystem fs = FileSystem.get(hadoopConfiguration);
	FsShell fsShell = new FsShell(hadoopConfiguration, fs);
	if (fsShell.test(testDir)) {
		fsShell.rmr(testDir);
	}
}
 
开发者ID:spring-cloud-stream-app-starters,项目名称:hdfs,代码行数:23,代码来源:DatasetSinkContextClosingTests.java

示例3: init

import org.springframework.data.hadoop.fs.FsShell; //导入依赖的package包/类
public static void init(FsShell shell) {
    if (booted) {
        LOGGER.info("meta manager already booted");
        return;
    }
    IndexManager.shell = shell;
    // create local folder
    File indexFolder = new File(localIndexFolder);
    if (!indexFolder.exists()) {
        if (!indexFolder.mkdirs()) {
            LOGGER.warn("can not create local index folder " + localIndexFolder);
        } else {
            LOGGER.info("local index folder " + localIndexFolder + " created ");
        }
    } else {
        LOGGER.info("local index folder " + localIndexFolder + " exists");
    }

}
 
开发者ID:at15,项目名称:tree-index,代码行数:20,代码来源:IndexManager.java

示例4: init

import org.springframework.data.hadoop.fs.FsShell; //导入依赖的package包/类
public static void init(FsShell shell) {
    if (booted) {
        LOGGER.info("meta manager already booted");
        return;
    }
    MetaManager.shell = shell;
    metaTableMap = new HashMap<>();
    // create local folder
    File metaFolder = new File(localMetaFolder);
    if (!metaFolder.exists()) {
        if (!metaFolder.mkdirs()) {
            LOGGER.warn("can not create local meta folder " + localMetaFolder);
        } else {
            LOGGER.info("local meta folder " + localMetaFolder + " created ");
        }
    } else {
        LOGGER.info("local meta folder " + localMetaFolder + " exists ");
    }
}
 
开发者ID:at15,项目名称:tree-index,代码行数:20,代码来源:MetaManager.java

示例5: setup

import org.springframework.data.hadoop.fs.FsShell; //导入依赖的package包/类
@Before
public void setup() {
	this.testDir=System.getProperty("java.io.tmpdir") + "/hdfs-sink";
	String[] env = {"server.port:0",
			"spring.hadoop.fsUri=file:///",
			"hdfs.directory=" + this.testDir};
	EnvironmentTestUtils.addEnvironment(this.context, env);
	this.context.register(HdfsSinkConfigurationTests.HdfsSinkApplication.class);
	this.context.refresh();
	this.fsShell = context.getBean(FsShell.class);
	this.sink = context.getBean(Sink.class);
	if (fsShell.test(testDir)) {
		fsShell.rmr(testDir);
	}
}
 
开发者ID:spring-cloud-stream-app-starters,项目名称:hdfs,代码行数:16,代码来源:HdfsSinkIntegrationTests.java

示例6: setup

import org.springframework.data.hadoop.fs.FsShell; //导入依赖的package包/类
@Before
public void setup() throws IOException {
	FileSystem fs = FileSystem.get(hadoopConfiguration);
	FsShell fsShell = new FsShell(hadoopConfiguration, fs);
	if (fsShell.test(testDir)) {
		fsShell.rmr(testDir);
	}
}
 
开发者ID:spring-cloud-stream-app-starters,项目名称:hdfs,代码行数:9,代码来源:DatasetSinkIntegrationTests.java

示例7: fsShell

import org.springframework.data.hadoop.fs.FsShell; //导入依赖的package包/类
@Bean
FsShell fsShell() {
    org.apache.hadoop.conf.Configuration hadoopConfiguration =
            new org.apache.hadoop.conf.Configuration();
    hadoopConfiguration.set("fs.defaultFS", "hdfs://borneo:8020");
    return new FsShell(hadoopConfiguration);
}
 
开发者ID:SpringOne2GX-2014,项目名称:Intro-to-Spring-Hadoop,代码行数:8,代码来源:Application.java

示例8: fsShell

import org.springframework.data.hadoop.fs.FsShell; //导入依赖的package包/类
@Bean
FsShell fsShell() {
	return new FsShell(hadoopConfiguration);
}
 
开发者ID:trisberg,项目名称:cf-demo,代码行数:5,代码来源:HadoopConfig.java


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