in.createValueBytes() : rawValues[count]; int recordLength = in.nextRaw(rawKeys, rawValue); if (recordLength == -1) { in.close();
reader.nextRaw(rawKey, rawValue); } else {
public int readMarker(SequenceFile.Reader reader) throws IOException { if (valueBytes == null) { valueBytes = reader.createValueBytes(); } rawKey.reset(); rawValue.reset(); // valueBytes need not be reset since nextRaw call does it (and it is a private method) int status = reader.nextRaw(rawKey, valueBytes); // if we reach EOF, return -1 if (status == -1) { return -1; } // Check if the marker key is valid and return the count if (isMarkerValid()) { valueBytes.writeUncompressedBytes(rawValue); rawValue.flush(); // rawValue.getData() may return a larger byte array but Ints.fromByteArray will only read the first four bytes return Ints.fromByteArray(rawValue.getData()); } // EOF not reached and marker is not valid, then thrown an IOException since we can't make progress throw new IOException(String.format("Invalid key for num entries appended found %s, expected : %s", new String(rawKey.getData()), TxConstants.TransactionLog.NUM_ENTRIES_APPENDED)); }
in.createValueBytes() : rawValues[count]; int recordLength = in.nextRaw(rawKeys, rawValue); if (recordLength == -1) { in.close();
in.createValueBytes() : rawValues[count]; int recordLength = in.nextRaw(rawKeys, rawValue); if (recordLength == -1) { in.close();
in.createValueBytes() : rawValues[count]; int recordLength = in.nextRaw(rawKeys, rawValue); if (recordLength == -1) { in.close();
in.createValueBytes() : rawValues[count]; int recordLength = in.nextRaw(rawKeys, rawValue); if (recordLength == -1) { in.close();
in.createValueBytes() : rawValues[count]; int recordLength = in.nextRaw(rawKeys, rawValue); if (recordLength == -1) { in.close();
in.createValueBytes() : rawValues[count]; int recordLength = in.nextRaw(rawKeys, rawValue); if (recordLength == -1) { in.close();
reader.nextRaw(rawKey, rawValue); } else {
reader.nextRaw(rawKey, rawValue); } else {
public int readMarker(SequenceFile.Reader reader) throws IOException { if (valueBytes == null) { valueBytes = reader.createValueBytes(); } rawKey.reset(); rawValue.reset(); // valueBytes need not be reset since nextRaw call does it (and it is a private method) int status = reader.nextRaw(rawKey, valueBytes); // if we reach EOF, return -1 if (status == -1) { return -1; } // Check if the marker key is valid and return the count if (isMarkerValid()) { valueBytes.writeUncompressedBytes(rawValue); rawValue.flush(); // rawValue.getData() may return a larger byte array but Ints.fromByteArray will only read the first four bytes return Ints.fromByteArray(rawValue.getData()); } // EOF not reached and marker is not valid, then thrown an IOException since we can't make progress throw new IOException(String.format("Invalid key for num entries appended found %s, expected : %s", new String(rawKey.getData()), TxConstants.TransactionLog.NUM_ENTRIES_APPENDED)); }
public int readMarker(SequenceFile.Reader reader) throws IOException { if (valueBytes == null) { valueBytes = reader.createValueBytes(); } rawKey.reset(); rawValue.reset(); // valueBytes need not be reset since nextRaw call does it (and it is a private method) int status = reader.nextRaw(rawKey, valueBytes); // if we reach EOF, return -1 if (status == -1) { return -1; } // Check if the marker key is valid and return the count if (isMarkerValid()) { valueBytes.writeUncompressedBytes(rawValue); rawValue.flush(); // rawValue.getData() may return a larger byte array but Ints.fromByteArray will only read the first four bytes return Ints.fromByteArray(rawValue.getData()); } // EOF not reached and marker is not valid, then thrown an IOException since we can't make progress throw new IOException(String.format("Invalid key for num entries appended found %s, expected : %s", new String(rawKey.getData()), TxConstants.TransactionLog.NUM_ENTRIES_APPENDED)); }
@Override public boolean nextKeyValue() throws IOException, InterruptedException { Preconditions.checkNotNull(reader); if (!more) { return false; } long pos = reader.getPosition(); kobuf.reset(); int recordLength = reader.nextRaw(kobuf, vbytes); if (recordLength < 0 || (pos >= end && reader.syncSeen())) { return more = false; } valueUncompressed = false; return true; }