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


Java Directories.DataDirectory方法代码示例

本文整理汇总了Java中org.apache.cassandra.db.Directories.DataDirectory方法的典型用法代码示例。如果您正苦于以下问题:Java Directories.DataDirectory方法的具体用法?Java Directories.DataDirectory怎么用?Java Directories.DataDirectory使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.cassandra.db.Directories的用法示例。


在下文中一共展示了Directories.DataDirectory方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getContextMapping

import org.apache.cassandra.db.Directories; //导入方法依赖的package包/类
/** Translates remote files to local files by creating a local sstable per remote sstable. */
public static PendingFile getContextMapping(PendingFile remote) throws IOException
{
    /* Create a local sstable for each remote sstable */
    Descriptor remotedesc = remote.desc;
    if (!remotedesc.isStreamCompatible())
        throw new UnsupportedOperationException(String.format("SSTable %s is not compatible with current version %s",
                                                              remote.getFilename(), Descriptor.Version.CURRENT));

    // new local sstable
    Table table = Table.open(remotedesc.ksname);
    ColumnFamilyStore cfStore = table.getColumnFamilyStore(remotedesc.cfname);
    Directories.DataDirectory localDir = cfStore.directories.getLocationCapableOfSize(remote.size);
    if (localDir == null)
        throw new RuntimeException("Insufficient disk space to store " + remote.size + " bytes");
    Descriptor localdesc = Descriptor.fromFilename(cfStore.getTempSSTablePath(cfStore.directories.getLocationForDisk(localDir)));

    return new PendingFile(localdesc, remote);
}
 
开发者ID:dprguiuc,项目名称:Cassandra-Wasef,代码行数:20,代码来源:StreamIn.java

示例2: getContextMapping

import org.apache.cassandra.db.Directories; //导入方法依赖的package包/类
/** Translates remote files to local files by creating a local sstable per remote sstable. */
public static PendingFile getContextMapping(PendingFile remote) throws IOException
{
    /* Create a local sstable for each remote sstable */
    Descriptor remotedesc = remote.desc;
    if (!remotedesc.isStreamCompatible())
        throw new UnsupportedOperationException(String.format("SSTable %s is not compatible with current version %s",
                                                              remote.getFilename(), Descriptor.Version.CURRENT));

    // new local sstable
    Table table = Table.open(remotedesc.ksname);
    ColumnFamilyStore cfStore = table.getColumnFamilyStore(remotedesc.cfname);
    Directories.DataDirectory localDir = cfStore.directories.getWriteableLocation();
    if (localDir == null)
        throw new RuntimeException("Insufficient disk space to store " + remote.size + " bytes");
    Descriptor localdesc = Descriptor.fromFilename(cfStore.getTempSSTablePath(cfStore.directories.getLocationForDisk(localDir)));

    return new PendingFile(localdesc, remote);
}
 
开发者ID:wso2,项目名称:wso2-cassandra,代码行数:20,代码来源:StreamIn.java

示例3: createWriter

import org.apache.cassandra.db.Directories; //导入方法依赖的package包/类
protected SSTableWriter createWriter(ColumnFamilyStore cfs, long totalSize, long repairedAt) throws IOException
{
    Directories.DataDirectory localDir = cfs.directories.getWriteableLocation(totalSize);
    if (localDir == null)
        throw new IOException("Insufficient disk space to store " + totalSize + " bytes");
    desc = Descriptor.fromFilename(cfs.getTempSSTablePath(cfs.directories.getLocationForDisk(localDir)));

    return new SSTableWriter(desc.filenameFor(Component.DATA), estimatedKeys, repairedAt);
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:10,代码来源:StreamReader.java

示例4: getWriteDirectory

import org.apache.cassandra.db.Directories; //导入方法依赖的package包/类
protected Directories.DataDirectory getWriteDirectory(long writeSize)
{
    Directories.DataDirectory directory = getDirectories().getWriteableLocation(writeSize);
    if (directory == null)
        throw new RuntimeException("Insufficient disk space to write " + writeSize + " bytes");

    return directory;
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:9,代码来源:DiskAwareRunnable.java

示例5: createWriter

import org.apache.cassandra.db.Directories; //导入方法依赖的package包/类
protected SSTableWriter createWriter(ColumnFamilyStore cfs, long totalSize) throws IOException
{
    Directories.DataDirectory localDir = cfs.directories.getWriteableLocation();
    if (localDir == null)
        throw new IOException("Insufficient disk space to store " + totalSize + " bytes");
    desc = Descriptor.fromFilename(cfs.getTempSSTablePath(cfs.directories.getLocationForDisk(localDir)));

    return new SSTableWriter(desc.filenameFor(Component.DATA), estimatedKeys);
}
 
开发者ID:pgaref,项目名称:ACaZoo,代码行数:10,代码来源:StreamReader.java

示例6: runMayThrow

import org.apache.cassandra.db.Directories; //导入方法依赖的package包/类
/**
 * Run this task after selecting the optimal disk for it
 */
protected void runMayThrow() throws Exception
{
    long writeSize;
    Directories.DataDirectory directory;
    while (true)
    {
        writeSize = getExpectedWriteSize();
        directory = getDirectories().getWriteableLocation();
        if (directory != null || !reduceScopeForLimitedSpace())
            break;
    }
    if (directory == null)
        throw new RuntimeException("Insufficient disk space to write " + writeSize + " bytes");

    directory.currentTasks.incrementAndGet();
    directory.estimatedWorkingSize.addAndGet(writeSize);
    try
    {
        runWith(getDirectories().getLocationForDisk(directory));
    }
    finally
    {
        directory.estimatedWorkingSize.addAndGet(-1 * writeSize);
        directory.currentTasks.decrementAndGet();
    }
}
 
开发者ID:pgaref,项目名称:ACaZoo,代码行数:30,代码来源:DiskAwareRunnable.java

示例7: switchCompactionLocation

import org.apache.cassandra.db.Directories; //导入方法依赖的package包/类
public void switchCompactionLocation(Directories.DataDirectory location)
{
    long currentPartitionsToWrite = Math.round(ratios[currentRatioIndex] * estimatedTotalKeys);
    @SuppressWarnings("resource")
    SSTableWriter writer = SSTableWriter.create(Descriptor.fromFilename(cfs.getSSTablePath(getDirectories().getLocationForDisk(location))),
                                                currentPartitionsToWrite,
                                                minRepairedAt,
                                                cfs.metadata,
                                                new MetadataCollector(allSSTables, cfs.metadata.comparator, 0),
                                                SerializationHeader.make(cfs.metadata, nonExpiredSSTables),
                                                txn);
    logger.trace("Switching writer, currentPartitionsToWrite = {}", currentPartitionsToWrite);
    sstableWriter.switchWriter(writer);

}
 
开发者ID:scylladb,项目名称:scylla-tools-java,代码行数:16,代码来源:SplittingSizeTieredCompactionWriter.java

示例8: switchCompactionLocation

import org.apache.cassandra.db.Directories; //导入方法依赖的package包/类
public void switchCompactionLocation(Directories.DataDirectory location)
{
    @SuppressWarnings("resource")
    SSTableWriter writer = SSTableWriter.create(Descriptor.fromFilename(cfs.getSSTablePath(getDirectories().getLocationForDisk(location))),
                                                estimatedTotalKeys / estimatedSSTables,
                                                minRepairedAt,
                                                cfs.metadata,
                                                new MetadataCollector(allSSTables, cfs.metadata.comparator, level),
                                                SerializationHeader.make(cfs.metadata, nonExpiredSSTables),
                                                txn);

    sstableWriter.switchWriter(writer);

}
 
开发者ID:scylladb,项目名称:scylla-tools-java,代码行数:15,代码来源:MaxSSTableSizeWriter.java

示例9: switchCompactionLocation

import org.apache.cassandra.db.Directories; //导入方法依赖的package包/类
public void switchCompactionLocation(Directories.DataDirectory directory)
{
    File sstableDirectory = getDirectories().getLocationForDisk(directory);
    @SuppressWarnings("resource")
    SSTableWriter writer = SSTableWriter.create(Descriptor.fromFilename(cfs.getSSTablePath(sstableDirectory)),
                                                averageEstimatedKeysPerSSTable,
                                                minRepairedAt,
                                                cfs.metadata,
                                                new MetadataCollector(allSSTables, cfs.metadata.comparator, currentLevel),
                                                SerializationHeader.make(cfs.metadata, nonExpiredSSTables),
                                                txn);
    sstableWriter.switchWriter(writer);
}
 
开发者ID:scylladb,项目名称:scylla-tools-java,代码行数:14,代码来源:MajorLeveledCompactionWriter.java

示例10: getWriteDirectory

import org.apache.cassandra.db.Directories; //导入方法依赖的package包/类
/**
 * Return a directory where we can expect expectedWriteSize to fit.
 */
public Directories.DataDirectory getWriteDirectory(long expectedWriteSize)
{
    Directories.DataDirectory directory = getDirectories().getWriteableLocation(expectedWriteSize);
    if (directory == null)
        throw new RuntimeException("Insufficient disk space to write " + expectedWriteSize + " bytes");

    return directory;
}
 
开发者ID:scylladb,项目名称:scylla-tools-java,代码行数:12,代码来源:CompactionAwareWriter.java

示例11: switchCompactionLocation

import org.apache.cassandra.db.Directories; //导入方法依赖的package包/类
@Override
protected void switchCompactionLocation(Directories.DataDirectory directory)
{
    @SuppressWarnings("resource")
    SSTableWriter writer = SSTableWriter.create(Descriptor.fromFilename(cfs.getSSTablePath(getDirectories().getLocationForDisk(directory))),
                                                estimatedTotalKeys,
                                                minRepairedAt,
                                                cfs.metadata,
                                                new MetadataCollector(txn.originals(), cfs.metadata.comparator, 0),
                                                SerializationHeader.make(cfs.metadata, nonExpiredSSTables),
                                                txn);
    sstableWriter.switchWriter(writer);
}
 
开发者ID:scylladb,项目名称:scylla-tools-java,代码行数:14,代码来源:DefaultCompactionWriter.java

示例12: getWriteDirectory

import org.apache.cassandra.db.Directories; //导入方法依赖的package包/类
protected Directories.DataDirectory getWriteDirectory(long writeSize)
{
    Directories.DataDirectory directory = getDirectories().getWriteableLocation(writeSize);
    if (directory == null)
        throw new FSWriteError(new IOException("Insufficient disk space to write " + writeSize + " bytes"), "");

    return directory;
}
 
开发者ID:scylladb,项目名称:scylla-tools-java,代码行数:9,代码来源:DiskAwareRunnable.java

示例13: createWriter

import org.apache.cassandra.db.Directories; //导入方法依赖的package包/类
protected SSTableWriter createWriter(ColumnFamilyStore cfs, long totalSize, long repairedAt) throws IOException
{
    Directories.DataDirectory localDir = cfs.directories.getWriteableLocation();
    if (localDir == null)
        throw new IOException("Insufficient disk space to store " + totalSize + " bytes");
    desc = Descriptor.fromFilename(cfs.getTempSSTablePath(cfs.directories.getLocationForDisk(localDir)));

    return new SSTableWriter(desc.filenameFor(Component.DATA), estimatedKeys, repairedAt);
}
 
开发者ID:daidong,项目名称:GraphTrek,代码行数:10,代码来源:StreamReader.java

示例14: runMayThrow

import org.apache.cassandra.db.Directories; //导入方法依赖的package包/类
/**
 * Run this task after selecting the optimal disk for it
 */
protected void runMayThrow() throws Exception
{
    long writeSize;
    Directories.DataDirectory directory;
    while (true)
    {
        writeSize = getExpectedWriteSize();
        directory = getDirectories().getLocationCapableOfSize(writeSize);
        if (directory != null || !reduceScopeForLimitedSpace())
            break;
    }
    if (directory == null)
        throw new RuntimeException("Insufficient disk space to write " + writeSize + " bytes");

    directory.currentTasks.incrementAndGet();
    directory.estimatedWorkingSize.addAndGet(writeSize);
    try
    {
        runWith(getDirectories().getLocationForDisk(directory));
    }
    finally
    {
        directory.estimatedWorkingSize.addAndGet(-1 * writeSize);
        directory.currentTasks.decrementAndGet();
    }
}
 
开发者ID:dprguiuc,项目名称:Cassandra-Wasef,代码行数:30,代码来源:DiskAwareRunnable.java

示例15: createWriter

import org.apache.cassandra.db.Directories; //导入方法依赖的package包/类
protected SSTableWriter createWriter(ColumnFamilyStore cfs, long totalSize, long repairedAt) throws IOException
{
    Directories.DataDirectory localDir = cfs.directories.getCompactionLocation();
    if (localDir == null)
        throw new IOException("Insufficient disk space to store " + totalSize + " bytes");
    desc = Descriptor.fromFilename(cfs.getTempSSTablePath(cfs.directories.getLocationForDisk(localDir)));

    return new SSTableWriter(desc.filenameFor(Component.DATA), estimatedKeys, repairedAt);
}
 
开发者ID:rajath26,项目名称:cassandra-trunk,代码行数:10,代码来源:StreamReader.java


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