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


Java FileUtils.createTempFile方法代码示例

本文整理汇总了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);
    }
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:23,代码来源:FailureDetector.java

示例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);
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:21,代码来源:BloomFilterTest.java

示例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);
}
 
开发者ID:pgaref,项目名称:ACaZoo,代码行数:20,代码来源:BloomFilterTest.java

示例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();
}
 
开发者ID:scylladb,项目名称:scylla-tools-java,代码行数:20,代码来源:BloomFilterTest.java

示例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);
    }
}
 
开发者ID:scylladb,项目名称:scylla-tools-java,代码行数:17,代码来源:FailureDetector.java

示例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);
}
 
开发者ID:scylladb,项目名称:scylla-tools-java,代码行数:8,代码来源:CLibraryTest.java

示例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);
}
 
开发者ID:pgaref,项目名称:ACaZoo,代码行数:7,代码来源:AutoSavingCache.java


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