本文整理汇总了Java中org.apache.cassandra.io.util.FileUtils.createTempFile方法的典型用法代码示例。如果您正苦于以下问题:Java FileUtils.createTempFile方法的具体用法?Java FileUtils.createTempFile怎么用?Java FileUtils.createTempFile使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.cassandra.io.util.FileUtils
的用法示例。
在下文中一共展示了FileUtils.createTempFile方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: dumpInterArrivalTimes
import org.apache.cassandra.io.util.FileUtils; //导入方法依赖的package包/类
/**
* Dump the inter arrival times for examination if necessary.
*/
public void dumpInterArrivalTimes()
{
File file = FileUtils.createTempFile("failuredetector-", ".dat");
OutputStream os = null;
try
{
os = new BufferedOutputStream(new FileOutputStream(file, true));
os.write(toString().getBytes());
}
catch (IOException e)
{
throw new FSWriteError(e, file);
}
finally
{
FileUtils.closeQuietly(os);
}
}
示例2: testHugeBFSerialization
import org.apache.cassandra.io.util.FileUtils; //导入方法依赖的package包/类
@Test
@Ignore
public void testHugeBFSerialization() throws IOException
{
ByteBuffer test = ByteBuffer.wrap(new byte[] {0, 1});
File file = FileUtils.createTempFile("bloomFilterTest-", ".dat");
BloomFilter filter = (BloomFilter) FilterFactory.getFilter(((long)Integer.MAX_VALUE / 8) + 1, 0.01d, true);
filter.add(test);
DataOutputStreamAndChannel out = new DataOutputStreamAndChannel(new FileOutputStream(file));
FilterFactory.serialize(filter, out);
filter.bitset.serialize(out);
out.close();
filter.close();
DataInputStream in = new DataInputStream(new FileInputStream(file));
BloomFilter filter2 = (BloomFilter) FilterFactory.deserialize(in, true);
Assert.assertTrue(filter2.isPresent(test));
FileUtils.closeQuietly(in);
}
示例3: testHugeBFSerialization
import org.apache.cassandra.io.util.FileUtils; //导入方法依赖的package包/类
@Test
@Ignore
public void testHugeBFSerialization() throws IOException
{
ByteBuffer test = ByteBuffer.wrap(new byte[] {0, 1});
File file = FileUtils.createTempFile("bloomFilterTest-", ".dat");
BloomFilter filter = (BloomFilter) FilterFactory.getFilter(((long)Integer.MAX_VALUE / 8) + 1, 0.01d, true);
filter.add(test);
DataOutputStream out = new DataOutputStream(new FileOutputStream(file));
FilterFactory.serialize(filter, out);
filter.bitset.serialize(out);
out.close();
DataInputStream in = new DataInputStream(new FileInputStream(file));
BloomFilter filter2 = (BloomFilter) FilterFactory.deserialize(in, true);
Assert.assertTrue(filter2.isPresent(test));
FileUtils.closeQuietly(in);
}
示例4: hugeBFSerialization
import org.apache.cassandra.io.util.FileUtils; //导入方法依赖的package包/类
static void hugeBFSerialization(boolean oldBfHashOrder) throws IOException
{
ByteBuffer test = ByteBuffer.wrap(new byte[] {0, 1});
File file = FileUtils.createTempFile("bloomFilterTest-", ".dat");
BloomFilter filter = (BloomFilter) FilterFactory.getFilter(((long) Integer.MAX_VALUE / 8) + 1, 0.01d, true, oldBfHashOrder);
filter.add(FilterTestHelper.wrap(test));
DataOutputStreamPlus out = new BufferedDataOutputStreamPlus(new FileOutputStream(file));
FilterFactory.serialize(filter, out);
filter.bitset.serialize(out);
out.close();
filter.close();
DataInputStream in = new DataInputStream(new FileInputStream(file));
BloomFilter filter2 = (BloomFilter) FilterFactory.deserialize(in, true, oldBfHashOrder);
Assert.assertTrue(filter2.isPresent(FilterTestHelper.wrap(test)));
FileUtils.closeQuietly(in);
filter2.close();
}
示例5: dumpInterArrivalTimes
import org.apache.cassandra.io.util.FileUtils; //导入方法依赖的package包/类
/**
* Dump the inter arrival times for examination if necessary.
*/
public void dumpInterArrivalTimes()
{
File file = FileUtils.createTempFile("failuredetector-", ".dat");
try (OutputStream os = new BufferedOutputStream(new FileOutputStream(file, true)))
{
os.write(toString().getBytes());
}
catch (IOException e)
{
throw new FSWriteError(e, file);
}
}
示例6: testSkipCache
import org.apache.cassandra.io.util.FileUtils; //导入方法依赖的package包/类
@Test
public void testSkipCache()
{
File file = FileUtils.createTempFile("testSkipCache", "1");
CLibrary.trySkipCache(file.getPath(), 0, 0);
}
示例7: tempCacheFile
import org.apache.cassandra.io.util.FileUtils; //导入方法依赖的package包/类
private SequentialWriter tempCacheFile(Pair<String, String> pathInfo)
{
File path = getCachePath(pathInfo.left, pathInfo.right, CURRENT_VERSION);
File tmpFile = FileUtils.createTempFile(path.getName(), null, path.getParentFile());
return SequentialWriter.open(tmpFile, true);
}