private static DeletionTime readDeletionTime(DataInput in, SSTableReader sstable, String filename) { try { return DeletionTime.serializer.deserialize(in); } catch (IOException e) { if (sstable != null) sstable.markSuspect(); throw new CorruptSSTableException(e, filename); } }
public boolean hasNext() { try { return atomIterator.hasNext(); } catch (IOError e) { // catch here b/c atomIterator is an AbstractIterator; hasNext reads the value if (e.getCause() instanceof IOException) { if (sstable != null) sstable.markSuspect(); throw new CorruptSSTableException((IOException)e.getCause(), filename); } else { throw e; } } }
public SSTableNamesIterator(SSTableReader sstable, FileDataInput file, DecoratedKey key, SortedSet<CellName> columns, RowIndexEntry indexEntry) { assert columns != null; this.sstable = sstable; this.columns = columns; this.key = key; try { read(sstable, file, indexEntry); } catch (IOException e) { sstable.markSuspect(); throw new CorruptSSTableException(e, sstable.getFilename()); } }
public SSTableNamesIterator(SSTableReader sstable, DecoratedKey key, SortedSet<CellName> columns) { assert columns != null; this.sstable = sstable; this.columns = columns; this.key = key; RowIndexEntry indexEntry = sstable.getPosition(key, SSTableReader.Operator.EQ); if (indexEntry == null) return; try { read(sstable, null, indexEntry); } catch (IOException e) { sstable.markSuspect(); throw new CorruptSSTableException(e, sstable.getFilename()); } finally { if (fileToClose != null) FileUtils.closeQuietly(fileToClose); } }
markSuspect(); throw new CorruptSSTableException(e, in.getPath());
markSuspect(); throw new CorruptSSTableException(e, in.getPath());
sstable.markSuspect(); throw new CorruptSSTableException(e, file.getPath());
public SimpleSliceReader(SSTableReader sstable, RowIndexEntry indexEntry, FileDataInput input, Composite finishColumn) { Tracing.trace("Seeking to partition beginning in data file"); this.finishColumn = finishColumn; this.comparator = sstable.metadata.comparator; try { if (input == null) { this.file = sstable.getFileDataInput(indexEntry.position); this.needsClosing = true; } else { this.file = input; input.seek(indexEntry.position); this.needsClosing = false; } // Skip key and data size ByteBufferUtil.skipShortLength(file); emptyColumnFamily = ArrayBackedSortedColumns.factory.create(sstable.metadata); emptyColumnFamily.delete(DeletionTime.serializer.deserialize(file)); atomIterator = emptyColumnFamily.metadata().getOnDiskIterator(file, sstable.descriptor.version); } catch (IOException e) { sstable.markSuspect(); throw new CorruptSSTableException(e, sstable.getFilename()); } }
private void seekToCurrentRangeStart() { long indexPosition = sstable.getIndexScanPosition(currentRange.left); ifile.seek(indexPosition); try { while (!ifile.isEOF()) { indexPosition = ifile.getFilePointer(); DecoratedKey indexDecoratedKey = sstable.partitioner.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 = ifile.readLong(); ifile.seek(indexPosition); dfile.seek(dataPosition); break; } else { RowIndexEntry.Serializer.skip(ifile); } } } catch (IOException e) { sstable.markSuspect(); throw new CorruptSSTableException(e, sstable.getFilename()); } }
markSuspect(); throw new CorruptSSTableException(e, in.getPath());
sstable.markSuspect(); throw new CorruptSSTableException(e, sstable.getFilename());