private void validate() { if (this.first.compareTo(this.last) > 0) { throw new CorruptSSTableException(new IllegalStateException(String.format("SSTable first key %s > last key %s", this.first, this.last)), getFilename()); } }
private void validate() { if (this.first.compareTo(this.last) > 0) { throw new CorruptSSTableException(new IllegalStateException(String.format("SSTable first key %s > last key %s", this.first, this.last)), getFilename()); } }
private void validate() { if (this.first.compareTo(this.last) > 0) { throw new CorruptSSTableException(new IllegalStateException(String.format("SSTable first key %s > last key %s", this.first, this.last)), getFilename()); } }
public OnDiskAtom next() { try { OnDiskAtom atom = atomIterator.next(); if (validateColumns) atom.validateFields(columnFamily.metadata()); return atom; } catch (MarshalException me) { throw new CorruptSSTableException(me, filename); } }
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 void close() { try { if (isClosed.compareAndSet(false, true)) FileUtils.close(dfile, ifile); } catch (IOException e) { sstable.markSuspect(); throw new CorruptSSTableException(e, sstable.getFilename()); } }
throw new CorruptSSTableException(e, indexFilePath);
throw new CorruptSSTableException(e, indexFilePath);
public void close() { try { if (isClosed.compareAndSet(false, true)) FileUtils.close(dfile, ifile); } catch (IOException e) { sstable.markSuspect(); throw new CorruptSSTableException(e, sstable.getFilename()); } }
throw new CorruptSSTableException(e, indexFilePath);
public void close() { try { if (isClosed.compareAndSet(false, true)) FileUtils.close(dfile, ifile); } catch (IOException e) { sstable.markSuspect(); throw new CorruptSSTableException(e, sstable.getFilename()); } }
public void close() { try { if (isClosed.compareAndSet(false, true)) FileUtils.close(dfile, ifile); } catch (IOException e) { sstable.markSuspect(); throw new CorruptSSTableException(e, sstable.getFilename()); } }
public void run() { SSTableReader sstable; try { sstable = open(entry.getKey(), entry.getValue(), metadata); } catch (CorruptSSTableException ex) { FileUtils.handleCorruptSSTable(ex); logger.error("Corrupt sstable {}; skipping table", entry, ex); return; } catch (FSError ex) { FileUtils.handleFSError(ex); logger.error("Cannot read sstable {}; file system error, skipping table", entry, ex); return; } catch (IOException ex) { FileUtils.handleCorruptSSTable(new CorruptSSTableException(ex, entry.getKey().filenameFor(Component.DATA))); logger.error("Cannot read sstable {}; other IO error, skipping table", entry, ex); return; } sstables.add(sstable); } };
public void close() { try { closeInternal(); } catch (IOException e) { sstable.markSuspect(); throw new CorruptSSTableException(e, reader.file.getPath()); } }
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()); } }
throw new CorruptSSTableException(new IOException(msg, e), indexFilePath);
public void run() { SSTableReader sstable; try { sstable = open(entry.getKey(), entry.getValue(), metadata); } catch (CorruptSSTableException ex) { FileUtils.handleCorruptSSTable(ex); logger.error("Corrupt sstable {}; skipping table", entry, ex); return; } catch (FSError ex) { FileUtils.handleFSError(ex); logger.error("Cannot read sstable {}; file system error, skipping table", entry, ex); return; } catch (IOException ex) { FileUtils.handleCorruptSSTable(new CorruptSSTableException(ex, entry.getKey().filenameFor(Component.DATA))); logger.error("Cannot read sstable {}; other IO error, skipping table", entry, ex); return; } sstables.add(sstable); } };
/** * 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 }
public void close() { try { closeInternal(); } catch (IOException e) { sstable.markSuspect(); throw new CorruptSSTableException(e, reader.file.getPath()); } }
public void close() { try { closeInternal(); } catch (IOException e) { sstable.markSuspect(); throw new CorruptSSTableException(e, reader.file.getPath()); } }