當前位置: 首頁>>代碼示例>>Java>>正文


Java GzipCodec.setConf方法代碼示例

本文整理匯總了Java中org.apache.hadoop.io.compress.GzipCodec.setConf方法的典型用法代碼示例。如果您正苦於以下問題:Java GzipCodec.setConf方法的具體用法?Java GzipCodec.setConf怎麽用?Java GzipCodec.setConf使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.apache.hadoop.io.compress.GzipCodec的用法示例。


在下文中一共展示了GzipCodec.setConf方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: setUp

import org.apache.hadoop.io.compress.GzipCodec; //導入方法依賴的package包/類
@Before
public void setUp() throws Exception {

	conf = new SystemConfiguration();

	// Create LZO Codec
	org.apache.hadoop.conf.Configuration hadoopConf = new org.apache.hadoop.conf.Configuration();
	GzipCodec gzipCodec = new GzipCodec();
	gzipCodec.setConf(hadoopConf);

	codec = gzipCodec;

	// Write out test file
	baseDir = new File(".", "target/testClientServerFailures/");
	baseDir.mkdirs();

	fileToStream = new File(baseDir, "test.txt");

	if (fileToStream.exists())
		fileToStream.delete();

	fileToStream.createNewFile();

	FileWriter writer = new FileWriter(fileToStream);
	BufferedWriter buffWriter = new BufferedWriter(writer);
	try {
		for (int i = 0; i < testLineCount; i++) {

			buffWriter.write(testString);
			buffWriter.write('\n');
		}
	} finally {
		buffWriter.close();
		writer.close();
	}
}
 
開發者ID:gerritjvv,項目名稱:bigstreams,代碼行數:37,代碼來源:TestFilesSendWorkerServerFailures.java

示例2: setUp

import org.apache.hadoop.io.compress.GzipCodec; //導入方法依賴的package包/類
@Before
public void setUp() throws Exception {

	// Create LZO Codec
	Configuration conf = new Configuration();
	GzipCodec gzipCodec = new GzipCodec();
	gzipCodec.setConf(conf);

	codec = gzipCodec;

	// Write out test file
	baseDir = new File(".", "target/testSendClientFiles/");
	baseDir.mkdirs();

	fileToStream = new File(baseDir, "test.txt");

	if (fileToStream.exists())
		fileToStream.delete();

	fileToStream.createNewFile();

	FileWriter writer = new FileWriter(fileToStream);
	BufferedWriter buffWriter = new BufferedWriter(writer);
	try {
		for (int i = 0; i < testLineCount; i++) {

			buffWriter.write(testString);
			buffWriter.write('\n');
		}
	} finally {
		buffWriter.close();
		writer.close();
	}

	// wait for file to be created
	while (!fileToStream.exists())
		;
}
 
開發者ID:gerritjvv,項目名稱:bigstreams,代碼行數:39,代碼來源:TestFilesSendWorker.java

示例3: setUp

import org.apache.hadoop.io.compress.GzipCodec; //導入方法依賴的package包/類
@Before
public void setUp() throws Exception {

	// Create LZO Codec
	Configuration conf = new Configuration();
	GzipCodec gzipCodec = new GzipCodec();
	gzipCodec.setConf(conf);

	codec = gzipCodec;

	// Write out test file
	baseDir = new File(".", "target/testSendClientFilesConflict/");
	baseDir.mkdirs();

	fileToStream = new File(baseDir, "test.txt");

	if (fileToStream.exists())
		fileToStream.delete();

	fileToStream.createNewFile();

	FileWriter writer = new FileWriter(fileToStream);
	BufferedWriter buffWriter = new BufferedWriter(writer);
	try {
		for (int i = 0; i < testLineCount; i++) {

			buffWriter.write(testString);
			buffWriter.write('\n');
		}
	} finally {
		buffWriter.close();
		writer.close();
	}

	// wait for file to be created
	while (!fileToStream.exists())
		;
}
 
開發者ID:gerritjvv,項目名稱:bigstreams,代碼行數:39,代碼來源:TestFilesSendWorkerConflict.java

示例4: EmoSplitInputStream

import org.apache.hadoop.io.compress.GzipCodec; //導入方法依賴的package包/類
private EmoSplitInputStream(String table, String split)
        throws IOException {
    if (isEmptySplit(split)) {
        _rows = Iterators.emptyIterator();
    } else {
        // Get the DataStore and begin streaming the split's rows.
        CloseableDataStore dataStore = HadoopDataStoreManager.getInstance().getDataStore(_uri, _apiKey, _metricRegistry);
        _closer.register(dataStore);

        _rows = DataStoreStreaming.getSplit(dataStore, table, split, ReadConsistency.STRONG).iterator();
    }

    _buffer.clear();
    _buffer.limit(0);
    GzipCodec gzipCodec = new GzipCodec();
    gzipCodec.setConf(new Configuration());

    // Set up the pipes
    PipedOutputStream pipeRawToGzip = new PipedOutputStream();
    _gzipIn = new PipedInputStream(pipeRawToGzip, 10 * 1024 * 1024);
    _rawOut = gzipCodec.createOutputStream(pipeRawToGzip);
    _closer.register(_gzipIn);
    _closer.register(pipeRawToGzip);

    // Start the asynchronous buffering thread
    _bufferThread = new Thread(new Runnable() {
        @Override
        public void run() {
            streamAndCompressInput();
        }
    });
    _bufferThread.start();
}
 
開發者ID:bazaarvoice,項目名稱:emodb,代碼行數:34,代碼來源:EmoFileSystem.java

示例5: buildCodec

import org.apache.hadoop.io.compress.GzipCodec; //導入方法依賴的package包/類
private GzipCodec buildCodec(Configuration conf) {
  GzipCodec gzcodec = new ReusableStreamGzipCodec();
  gzcodec.setConf(new Configuration(conf));
  return gzcodec;
}
 
開發者ID:fengchen8086,項目名稱:ditb,代碼行數:6,代碼來源:Compression.java

示例6: setUp

import org.apache.hadoop.io.compress.GzipCodec; //導入方法依賴的package包/類
@Before
public void setUp() throws Exception {

	bootstrap = new Bootstrap();
	bootstrap.loadProfiles(CommandLineProcessorFactory.PROFILE.DB,
			CommandLineProcessorFactory.PROFILE.AGENT);

	conf = new SystemConfiguration();

	// Create LZO Codec
	org.apache.hadoop.conf.Configuration hadoopConf = new org.apache.hadoop.conf.Configuration();
	GzipCodec gzipCodec = new GzipCodec();
	gzipCodec.setConf(hadoopConf);

	codec = gzipCodec;

	// Write out test file
	baseDir = new File(".", "target/testSendClientFiles/");
	baseDir.mkdirs();

	fileToStream = new File(baseDir, "test.txt");

	if (fileToStream.exists())
		fileToStream.delete();

	fileToStream.createNewFile();

	FileWriter writer = new FileWriter(fileToStream);
	BufferedWriter buffWriter = new BufferedWriter(writer);
	try {
		for (int i = 0; i < testLineCount; i++) {

			buffWriter.write(testString);
			buffWriter.write('\n');
		}
	} finally {
		buffWriter.close();
		writer.close();
	}

}
 
開發者ID:gerritjvv,項目名稱:bigstreams,代碼行數:42,代碼來源:TestSendClientFiles.java

示例7: setUp

import org.apache.hadoop.io.compress.GzipCodec; //導入方法依賴的package包/類
@Before
public void setUp() throws Exception {

	String arch = System.getProperty("os.arch");
	String libPath = null;
	if (arch.contains("i386")) {
		libPath = new File(".", "src/main/resources/native/Linux-i386-32")
				.getAbsolutePath();
	} else {
		libPath = new File(".", "src/main/resources/native/Linux-amd64-64")
				.getAbsolutePath();
	}

	System.setProperty("java.library.path", libPath);

	// Create LZO Codec
	Configuration conf = new Configuration();
	GzipCodec gzipCodec = new GzipCodec();
	gzipCodec.setConf(conf);

	codec = gzipCodec;

	// Write out test file
	baseDir = new File(".", "target/fileLineStreamerTest/");
	baseDir.mkdirs();

	fileToStream = new File(baseDir, "test.txt");

	if (fileToStream.exists())
		fileToStream.delete();

	fileToStream.createNewFile();

	FileWriter writer = new FileWriter(fileToStream);
	BufferedWriter buffWriter = new BufferedWriter(writer);
	try {
		for (int i = 0; i < testLineCount; i++) {

			buffWriter.write(testString);
			buffWriter.write('\n');
		}
	} finally {
		buffWriter.close();
		writer.close();
	}

}
 
開發者ID:gerritjvv,項目名稱:bigstreams,代碼行數:48,代碼來源:TestFileLineStreamerImpl.java


注:本文中的org.apache.hadoop.io.compress.GzipCodec.setConf方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。