Package com.google.appengine.tools.mapreduce.impl.util.LevelDbConstants

Examples of com.google.appengine.tools.mapreduce.impl.util.LevelDbConstants.RecordType


    int checksum = tmpBuffer.getInt();
    int length = tmpBuffer.getShort();
    if (length > bytesToBlockEnd || length < 0) {
      throw new CorruptDataException("Length is too large:" + length);
    }
    RecordType type = RecordType.get(tmpBuffer.get());
    if (type == RecordType.NONE && length == 0) {
      length = bytesToBlockEnd - HEADER_LENGTH;
    }
    readToTmp(length, false);

    if (!isValidCrc(checksum, tmpBuffer, type.value())) {
      throw new CorruptDataException("Checksum doesn't validate.");
    }
    return createRecordFromTmp(type);
  }
View Full Code Here


   * @param lastRecord a {@link Record} representing the last physical record written.
   * @return the {@link Record} with new write data.
   **/
  private static Record createRecord(ByteBuffer data, int bytesToBlockEnd, Record lastRecord) {
    int bytesToDataEnd = data.remaining();
    RecordType type = RecordType.UNKNOWN;
    int bytes = -1;
    if ((lastRecord.getType() == RecordType.NONE)
        && ((bytesToDataEnd + LevelDbConstants.HEADER_LENGTH) <= bytesToBlockEnd)) {
      // Can write entire record in current block
      type = RecordType.FULL;
View Full Code Here

TOP

Related Classes of com.google.appengine.tools.mapreduce.impl.util.LevelDbConstants.RecordType

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.