• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java CorruptSSTableException类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.apache.cassandra.io.sstable.CorruptSSTableException的典型用法代码示例。如果您正苦于以下问题:Java CorruptSSTableException类的具体用法?Java CorruptSSTableException怎么用?Java CorruptSSTableException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



CorruptSSTableException类属于org.apache.cassandra.io.sstable包,在下文中一共展示了CorruptSSTableException类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: inspectThrowable

import org.apache.cassandra.io.sstable.CorruptSSTableException; //导入依赖的package包/类
/**
 * Certain Throwables and Exceptions represent "Die" conditions for the server.
 * This recursively checks the input Throwable's cause hierarchy until null.
 * @param t
 *      The Throwable to check for server-stop conditions
 */
public static void inspectThrowable(Throwable t)
{
    boolean isUnstable = false;
    if (t instanceof OutOfMemoryError)
    {
        isUnstable = true;
        HeapUtils.generateHeapDump();
    }

    if (DatabaseDescriptor.getDiskFailurePolicy() == Config.DiskFailurePolicy.die)
        if (t instanceof FSError || t instanceof CorruptSSTableException)
        isUnstable = true;

    // Check for file handle exhaustion
    if (t instanceof FileNotFoundException || t instanceof SocketException)
        if (t.getMessage().contains("Too many open files"))
            isUnstable = true;

    if (isUnstable)
        killer.killCurrentJVM(t);

    if (t.getCause() != null)
        inspectThrowable(t.getCause());
}
 
开发者ID:Netflix,项目名称:sstable-adaptor,代码行数:31,代码来源:JVMStabilityInspector.java


示例2: hasNext

import org.apache.cassandra.io.sstable.CorruptSSTableException; //导入依赖的package包/类
public boolean hasNext()
{
    try
    {
        return hasNextInternal();
    }
    catch (IOException | IndexOutOfBoundsException e)
    {
        try
        {
            closeInternal();
        }
        catch (IOException suppressed)
        {
            e.addSuppressed(suppressed);
        }
        sstable.markSuspect();
        throw new CorruptSSTableException(e, reader.file.getPath());
    }
}
 
开发者ID:Netflix,项目名称:sstable-adaptor,代码行数:21,代码来源:AbstractSSTableIterator.java


示例3: next

import org.apache.cassandra.io.sstable.CorruptSSTableException; //导入依赖的package包/类
public Unfiltered next()
{
    try
    {
        return nextInternal();
    }
    catch (IOException e)
    {
        try
        {
            closeInternal();
        }
        catch (IOException suppressed)
        {
            e.addSuppressed(suppressed);
        }
        sstable.markSuspect();
        throw new CorruptSSTableException(e, reader.file.getPath());
    }
}
 
开发者ID:Netflix,项目名称:sstable-adaptor,代码行数:21,代码来源:AbstractSSTableIterator.java


示例4: rebuffer

import org.apache.cassandra.io.sstable.CorruptSSTableException; //导入依赖的package包/类
@Override
public Buffer rebuffer(long position)
{
    try
    {
        metrics.requests.mark();
        long pageAlignedPos = position & alignmentMask;
        Buffer buf;
        do
            buf = cache.get(new Key(source, pageAlignedPos)).reference();
        while (buf == null);

        return buf;
    }
    catch (Throwable t)
    {
        Throwables.propagateIfInstanceOf(t.getCause(), CorruptSSTableException.class);
        throw Throwables.propagate(t);
    }
}
 
开发者ID:Netflix,项目名称:sstable-adaptor,代码行数:21,代码来源:ChunkCache.java


示例5: chunkFor

import org.apache.cassandra.io.sstable.CorruptSSTableException; //导入依赖的package包/类
/**
 * Get a chunk of compressed data (offset, length) corresponding to given position
 *
 * @param position Position in the file.
 * @return pair of chunk offset and length.
 */
public Chunk chunkFor(long position)
{
    // position of the chunk
    int idx = 8 * (int) (position / parameters.chunkLength());

    if (idx >= chunkOffsetsSize)
        throw new CorruptSSTableException(new EOFException(), indexFilePath);

    long chunkOffset = chunkOffsets.getLong(idx);
    long nextChunkOffset = (idx + 8 == chunkOffsetsSize)
                            ? compressedFileLength
                            : chunkOffsets.getLong(idx + 8);

    return new Chunk(chunkOffset, (int) (nextChunkOffset - chunkOffset - 4)); // "4" bytes reserved for checksum
}
 
开发者ID:Netflix,项目名称:sstable-adaptor,代码行数:22,代码来源:CompressionMetadata.java


示例6: inspectThrowable

import org.apache.cassandra.io.sstable.CorruptSSTableException; //导入依赖的package包/类
/**
 * Certain Throwables and Exceptions represent "Die" conditions for the server.
 * @param t
 *      The Throwable to check for server-stop conditions
 */
public static void inspectThrowable(Throwable t)
{
    boolean isUnstable = false;
    if (t instanceof OutOfMemoryError)
        isUnstable = true;

    if (DatabaseDescriptor.getDiskFailurePolicy() == Config.DiskFailurePolicy.die)
        if (t instanceof FSError || t instanceof CorruptSSTableException)
        isUnstable = true;

    // Check for file handle exhaustion
    if (t instanceof FileNotFoundException || t instanceof SocketException)
        if (t.getMessage().contains("Too many open files"))
            isUnstable = true;

    if (isUnstable)
        killer.killCurrentJVM(t);
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:24,代码来源:JVMStabilityInspector.java


示例7: chunkFor

import org.apache.cassandra.io.sstable.CorruptSSTableException; //导入依赖的package包/类
/**
 * Get a chunk of compressed data (offset, length) corresponding to given position
 *
 * @param position Position in the file.
 * @return pair of chunk offset and length.
 */
public Chunk chunkFor(long position)
{
    // position of the chunk
    int idx = 8 * (int) (position / parameters.chunkLength());

    if (idx >= chunkOffsets.size())
        throw new CorruptSSTableException(new EOFException(), indexFilePath);

    long chunkOffset = chunkOffsets.getLong(idx);
    long nextChunkOffset = (idx + 8 == chunkOffsets.size())
                            ? compressedFileLength
                            : chunkOffsets.getLong(idx + 8);

    return new Chunk(chunkOffset, (int) (nextChunkOffset - chunkOffset - 4)); // "4" bytes reserved for checksum
}
 
开发者ID:pgaref,项目名称:ACaZoo,代码行数:22,代码来源:CompressionMetadata.java


示例8: hasNext

import org.apache.cassandra.io.sstable.CorruptSSTableException; //导入依赖的package包/类
public boolean hasNext() 
{
    try
    {
        return hasNextInternal();
    }
    catch (IOException | IndexOutOfBoundsException e)
    {
        try
        {
            closeInternal();
        }
        catch (IOException suppressed)
        {
            e.addSuppressed(suppressed);
        }
        sstable.markSuspect();
        throw new CorruptSSTableException(e, reader.file.getPath());
    }
}
 
开发者ID:scylladb,项目名称:scylla-tools-java,代码行数:21,代码来源:AbstractSSTableIterator.java


示例9: testVerifyCorrect

import org.apache.cassandra.io.sstable.CorruptSSTableException; //导入依赖的package包/类
@Test
public void testVerifyCorrect() throws IOException
{
    CompactionManager.instance.disableAutoCompaction();
    Keyspace keyspace = Keyspace.open(KEYSPACE);
    ColumnFamilyStore cfs = keyspace.getColumnFamilyStore(CF);

    fillCF(cfs, 2);

    SSTableReader sstable = cfs.getLiveSSTables().iterator().next();

    try (Verifier verifier = new Verifier(cfs, sstable, false))
    {
        verifier.verify(false);
    }
    catch (CorruptSSTableException err)
    {
        fail("Unexpected CorruptSSTableException");
    }
}
 
开发者ID:scylladb,项目名称:scylla-tools-java,代码行数:21,代码来源:VerifyTest.java


示例10: testVerifyCounterCorrect

import org.apache.cassandra.io.sstable.CorruptSSTableException; //导入依赖的package包/类
@Test
public void testVerifyCounterCorrect() throws IOException
{
    CompactionManager.instance.disableAutoCompaction();
    Keyspace keyspace = Keyspace.open(KEYSPACE);
    ColumnFamilyStore cfs = keyspace.getColumnFamilyStore(COUNTER_CF);

    fillCounterCF(cfs, 2);

    SSTableReader sstable = cfs.getLiveSSTables().iterator().next();

    try (Verifier verifier = new Verifier(cfs, sstable, false))
    {
        verifier.verify(false);
    }
    catch (CorruptSSTableException err)
    {
        fail("Unexpected CorruptSSTableException");
    }
}
 
开发者ID:scylladb,项目名称:scylla-tools-java,代码行数:21,代码来源:VerifyTest.java


示例11: testExtendedVerifyCorrect

import org.apache.cassandra.io.sstable.CorruptSSTableException; //导入依赖的package包/类
@Test
public void testExtendedVerifyCorrect() throws IOException
{
    CompactionManager.instance.disableAutoCompaction();
    Keyspace keyspace = Keyspace.open(KEYSPACE);
    ColumnFamilyStore cfs = keyspace.getColumnFamilyStore(CF2);

    fillCF(cfs, 2);

    SSTableReader sstable = cfs.getLiveSSTables().iterator().next();

    try (Verifier verifier = new Verifier(cfs, sstable, false))
    {
        verifier.verify(true);
    }
    catch (CorruptSSTableException err)
    {
        fail("Unexpected CorruptSSTableException");
    }
}
 
开发者ID:scylladb,项目名称:scylla-tools-java,代码行数:21,代码来源:VerifyTest.java


示例12: testExtendedVerifyCounterCorrect

import org.apache.cassandra.io.sstable.CorruptSSTableException; //导入依赖的package包/类
@Test
public void testExtendedVerifyCounterCorrect() throws IOException
{
    CompactionManager.instance.disableAutoCompaction();
    Keyspace keyspace = Keyspace.open(KEYSPACE);
    ColumnFamilyStore cfs = keyspace.getColumnFamilyStore(COUNTER_CF2);

    fillCounterCF(cfs, 2);

    SSTableReader sstable = cfs.getLiveSSTables().iterator().next();

    try (Verifier verifier = new Verifier(cfs, sstable, false))
    {
        verifier.verify(true);
    }
    catch (CorruptSSTableException err)
    {
        fail("Unexpected CorruptSSTableException");
    }
}
 
开发者ID:scylladb,项目名称:scylla-tools-java,代码行数:21,代码来源:VerifyTest.java


示例13: testVerifyCorrectUncompressed

import org.apache.cassandra.io.sstable.CorruptSSTableException; //导入依赖的package包/类
@Test
public void testVerifyCorrectUncompressed() throws IOException
{
    CompactionManager.instance.disableAutoCompaction();
    Keyspace keyspace = Keyspace.open(KEYSPACE);
    ColumnFamilyStore cfs = keyspace.getColumnFamilyStore(CF3);

    fillCF(cfs, 2);

    SSTableReader sstable = cfs.getLiveSSTables().iterator().next();

    try (Verifier verifier = new Verifier(cfs, sstable, false))
    {
        verifier.verify(false);
    }
    catch (CorruptSSTableException err)
    {
        fail("Unexpected CorruptSSTableException");
    }
}
 
开发者ID:scylladb,项目名称:scylla-tools-java,代码行数:21,代码来源:VerifyTest.java


示例14: testVerifyCounterCorrectUncompressed

import org.apache.cassandra.io.sstable.CorruptSSTableException; //导入依赖的package包/类
@Test
public void testVerifyCounterCorrectUncompressed() throws IOException
{
    CompactionManager.instance.disableAutoCompaction();
    Keyspace keyspace = Keyspace.open(KEYSPACE);
    ColumnFamilyStore cfs = keyspace.getColumnFamilyStore(COUNTER_CF3);

    fillCounterCF(cfs, 2);

    SSTableReader sstable = cfs.getLiveSSTables().iterator().next();

    try (Verifier verifier = new Verifier(cfs, sstable, false))
    {
        verifier.verify(false);
    }
    catch (CorruptSSTableException err)
    {
        fail("Unexpected CorruptSSTableException");
    }
}
 
开发者ID:scylladb,项目名称:scylla-tools-java,代码行数:21,代码来源:VerifyTest.java


示例15: testExtendedVerifyCorrectUncompressed

import org.apache.cassandra.io.sstable.CorruptSSTableException; //导入依赖的package包/类
@Test
public void testExtendedVerifyCorrectUncompressed() throws IOException
{
    CompactionManager.instance.disableAutoCompaction();
    Keyspace keyspace = Keyspace.open(KEYSPACE);
    ColumnFamilyStore cfs = keyspace.getColumnFamilyStore(CF4);

    fillCF(cfs, 2);

    SSTableReader sstable = cfs.getLiveSSTables().iterator().next();

    try (Verifier verifier = new Verifier(cfs, sstable, false))
    {
        verifier.verify(true);
    }
    catch (CorruptSSTableException err)
    {
        fail("Unexpected CorruptSSTableException");
    }
}
 
开发者ID:scylladb,项目名称:scylla-tools-java,代码行数:21,代码来源:VerifyTest.java


示例16: testExtendedVerifyCounterCorrectUncompressed

import org.apache.cassandra.io.sstable.CorruptSSTableException; //导入依赖的package包/类
@Test
public void testExtendedVerifyCounterCorrectUncompressed() throws IOException
{
    CompactionManager.instance.disableAutoCompaction();
    Keyspace keyspace = Keyspace.open(KEYSPACE);
    ColumnFamilyStore cfs = keyspace.getColumnFamilyStore(COUNTER_CF4);

    fillCounterCF(cfs, 2);

    SSTableReader sstable = cfs.getLiveSSTables().iterator().next();

    try (Verifier verifier = new Verifier(cfs, sstable, false))
    {
        verifier.verify(true);
    }
    catch (CorruptSSTableException err)
    {
        fail("Unexpected CorruptSSTableException");
    }
}
 
开发者ID:scylladb,项目名称:scylla-tools-java,代码行数:21,代码来源:VerifyTest.java


示例17: chunkFor

import org.apache.cassandra.io.sstable.CorruptSSTableException; //导入依赖的package包/类
/**
 * Get a chunk of compressed data (offset, length) corresponding to given position
 *
 * @param position Position in the file.
 * @return pair of chunk offset and length.
 */
public Chunk chunkFor(long position)
{
    // position of the chunk
    int idx = 8 * (int) (position / parameters.chunkLength());

    if (idx >= chunkOffsetsSize)
        throw new CorruptSSTableException(new EOFException(), indexFilePath);

    long chunkOffset = chunkOffsets.getLong(idx);
    long nextChunkOffset = (idx + 8 == chunkOffsets.size())
                            ? compressedFileLength
                            : chunkOffsets.getLong(idx + 8);

    return new Chunk(chunkOffset, (int) (nextChunkOffset - chunkOffset - 4)); // "4" bytes reserved for checksum
}
 
开发者ID:daidong,项目名称:GraphTrek,代码行数:22,代码来源:CompressionMetadata.java


示例18: computeNext

import org.apache.cassandra.io.sstable.CorruptSSTableException; //导入依赖的package包/类
protected OnDiskAtom computeNext()
{
    if (i++ >= columns)
        return endOfData();

    OnDiskAtom column;
    try
    {
        file.reset(mark);
        column = atomSerializer.deserializeFromSSTable(file, sstable.descriptor.version);
    }
    catch (IOException e)
    {
        throw new CorruptSSTableException(e, file.getPath());
    }
    if (finishColumn.remaining() > 0 && comparator.compare(column.name(), finishColumn) > 0)
        return endOfData();

    mark = file.mark();
    return column;
}
 
开发者ID:dprguiuc,项目名称:Cassandra-Wasef,代码行数:22,代码来源:SimpleSliceReader.java


示例19: close

import org.apache.cassandra.io.sstable.CorruptSSTableException; //导入依赖的package包/类
public void close()
{
    try
    {
        closeInternal();
    }
    catch (IOException e)
    {
        sstable.markSuspect();
        throw new CorruptSSTableException(e, reader.file.getPath());
    }
}
 
开发者ID:Netflix,项目名称:sstable-adaptor,代码行数:13,代码来源:AbstractSSTableIterator.java


示例20: seekToCurrentRangeStart

import org.apache.cassandra.io.sstable.CorruptSSTableException; //导入依赖的package包/类
private void seekToCurrentRangeStart()
{
    long indexPosition = sstable.getIndexScanPosition(currentRange.left);
    ifile.seek(indexPosition);
    try
    {

        while (!ifile.isEOF())
        {
            indexPosition = ifile.getFilePointer();
            DecoratedKey indexDecoratedKey = sstable.decorateKey(ByteBufferUtil.readWithShortLength(ifile));
            if (indexDecoratedKey.compareTo(currentRange.left) > 0 || currentRange.contains(indexDecoratedKey))
            {
                // Found, just read the dataPosition and seek into index and data files
                long dataPosition = RowIndexEntry.Serializer.readPosition(ifile, sstable.descriptor.version);
                ifile.seek(indexPosition);
                dfile.seek(dataPosition);
                break;
            }
            else
            {
                RowIndexEntry.Serializer.skip(ifile, sstable.descriptor.version);
            }
        }
    }
    catch (IOException e)
    {
        sstable.markSuspect();
        throw new CorruptSSTableException(e, sstable.getFilename());
    }
}
 
开发者ID:Netflix,项目名称:sstable-adaptor,代码行数:32,代码来源:BigTableScanner.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ServletDeploymentContext类代码示例发布时间:2022-05-22
下一篇:
Java Configuration类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap