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


Java FileDataInput.getPath方法代码示例

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


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

示例1: create

import org.apache.cassandra.io.util.FileDataInput; //导入方法依赖的package包/类
public static SSTableIdentityIterator create(SSTableReader sstable, FileDataInput dfile, RowIndexEntry<?> indexEntry, DecoratedKey key, boolean tombstoneOnly)
{
    try
    {
        dfile.seek(indexEntry.position);
        ByteBufferUtil.skipShortLength(dfile); // Skip partition key
        DeletionTime partitionLevelDeletion = DeletionTime.serializer.deserialize(dfile);
        SerializationHelper helper = new SerializationHelper(sstable.metadata, sstable.descriptor.version.correspondingMessagingVersion(), SerializationHelper.Flag.LOCAL);
        SSTableSimpleIterator iterator = tombstoneOnly
                ? SSTableSimpleIterator.createTombstoneOnly(sstable.metadata, dfile, sstable.header, helper, partitionLevelDeletion)
                : SSTableSimpleIterator.create(sstable.metadata, dfile, sstable.header, helper, partitionLevelDeletion);
        return new SSTableIdentityIterator(sstable, key, partitionLevelDeletion, dfile.getPath(), iterator);
    }
    catch (IOException e)
    {
        sstable.markSuspect();
        throw new CorruptSSTableException(e, dfile.getPath());
    }
}
 
开发者ID:Netflix,项目名称:sstable-adaptor,代码行数:20,代码来源:SSTableIdentityIterator.java

示例2: firstKeyBeyond

import org.apache.cassandra.io.util.FileDataInput; //导入方法依赖的package包/类
/**
 * Finds and returns the first key beyond a given token in this SSTable or null if no such key exists.
 */
public DecoratedKey firstKeyBeyond(RowPosition token)
{
    if (token.compareTo(first) < 0)
        return first;

    long sampledPosition = getIndexScanPosition(token);

    Iterator<FileDataInput> segments = ifile.iterator(sampledPosition);
    while (segments.hasNext())
    {
        FileDataInput in = segments.next();
        try
        {
            while (!in.isEOF())
            {
                ByteBuffer indexKey = ByteBufferUtil.readWithShortLength(in);
                DecoratedKey indexDecoratedKey = partitioner.decorateKey(indexKey);
                if (indexDecoratedKey.compareTo(token) > 0)
                    return indexDecoratedKey;

                RowIndexEntry.Serializer.skip(in);
            }
        }
        catch (IOException e)
        {
            markSuspect();
            throw new CorruptSSTableException(e, in.getPath());
        }
        finally
        {
            FileUtils.closeQuietly(in);
        }
    }

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

示例3: firstKeyBeyond

import org.apache.cassandra.io.util.FileDataInput; //导入方法依赖的package包/类
/**
 * Finds and returns the first key beyond a given token in this SSTable or null if no such key exists.
 */
public DecoratedKey firstKeyBeyond(RowPosition token)
{
    long sampledPosition = getIndexScanPosition(token);
    if (sampledPosition == -1)
        sampledPosition = 0;

    Iterator<FileDataInput> segments = ifile.iterator(sampledPosition);
    while (segments.hasNext())
    {
        FileDataInput in = segments.next();
        try
        {
            while (!in.isEOF())
            {
                ByteBuffer indexKey = ByteBufferUtil.readWithShortLength(in);
                DecoratedKey indexDecoratedKey = partitioner.decorateKey(indexKey);
                if (indexDecoratedKey.compareTo(token) > 0)
                    return indexDecoratedKey;

                RowIndexEntry.Serializer.skip(in);
            }
        }
        catch (IOException e)
        {
            markSuspect();
            throw new CorruptSSTableException(e, in.getPath());
        }
        finally
        {
            FileUtils.closeQuietly(in);
        }
    }

    return null;
}
 
开发者ID:daidong,项目名称:GraphTrek,代码行数:39,代码来源:SSTableReader.java

示例4: validateSummarySamplingLevel

import org.apache.cassandra.io.util.FileDataInput; //导入方法依赖的package包/类
/**
 * Validates that an index summary has full sampling, as expected when the serialization format does not support
 * persisting the sampling level.
 * @return true if the summary has full sampling, false otherwise
 */
private boolean validateSummarySamplingLevel()
{
    // We need to check index summary entries against the index to verify that none of them were dropped due to
    // downsampling.  Downsampling can drop any of the first BASE_SAMPLING_LEVEL entries (repeating that drop pattern
    // for the remainder of the summary).  Unfortunately, the first entry to be dropped is the entry at
    // index (BASE_SAMPLING_LEVEL - 1), so we need to check a full set of BASE_SAMPLING_LEVEL entries.
    Iterator<FileDataInput> segments = ifile.iterator(0);
    int i = 0;
    int summaryEntriesChecked = 0;
    int expectedIndexInterval = getMinIndexInterval();
    while (segments.hasNext())
    {
        FileDataInput in = segments.next();
        try
        {
            while (!in.isEOF())
            {
                ByteBuffer indexKey = ByteBufferUtil.readWithShortLength(in);
                if (i % expectedIndexInterval == 0)
                {
                    ByteBuffer summaryKey = ByteBuffer.wrap(indexSummary.getKey(i / expectedIndexInterval));
                    if (!summaryKey.equals(indexKey))
                        return false;
                    summaryEntriesChecked++;

                    if (summaryEntriesChecked == Downsampling.BASE_SAMPLING_LEVEL)
                        return true;
                }
                RowIndexEntry.Serializer.skip(in);
                i++;
            }
        }
        catch (IOException e)
        {
            markSuspect();
            throw new CorruptSSTableException(e, in.getPath());
        }
        finally
        {
            FileUtils.closeQuietly(in);
        }
    }

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


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