Exemple #1
0
 @Override
 public void readFields(BufferReaderWriter reader) {
   run = reader.readString();
   queryid = reader.readInt();
   recall = reader.readDouble();
   precision = reader.readDouble();
 }
 public void read() {
   openRead();
   try {
     while (true) {
       ByteSearchSection section = reader.readSectionStart(root.section);
       if (section.notEmpty()) {
         section = root.readNode(section);
         reader.movePast(section);
       }
     }
   } catch (EOCException ex) {
   }
   closeRead();
 }
 public void openRead() {
   checkFirstUse();
   if (datafile != null) {
     if (reader == null) {
       reader = datafile.rwbuffer;
     }
     datafile.openRead();
     if (hasHeader) {
       ByteSearchSection section = reader.readSectionStart(root.section);
       if (section.notEmpty()) {
         root.readHeader(section);
         reader.movePast(section);
       }
     }
   }
 }
 /**
  * @param id
  * @return the offset in the datafile of the record(group) that contains the record with the given
  *     ID.
  */
 public long getOffset(int id) {
   long offset = -1;
   try {
     int marker = getMarkerOffset(id);
     int jumpindex = getJumpIndex(id);
     residenttable.setOffset(marker);
     offset = residenttable.readInt();
     for (int i = 0; i < jumpindex; i++) {
       offset += residenttable.readByte();
     }
     // log.info("getOffset() bucketindex %d marker %d jumpindex %d offset %d", bucketindex,
     // marker, jumpindex, offset);
   } catch (EOCException ex) {
     log.fatalexception(ex, "getOffset( %d ) residenttable %s", id, residenttable);
   }
   return offset;
 }
 public boolean nextRecord() {
   try {
     while (true) {
       ByteSearchSection section = reader.readSectionStart(root.section);
       if (validRecord(section)) {
         root.emptyDataContainer();
         section = root.readNode(section);
         reader.movePast(section);
         return true;
       }
       reader.movePast(section);
       if (!reader.hasMore()) {
         break;
       }
     }
   } catch (EOCException ex) {
   }
   root.emptyDataContainer();
   return false;
 }
 @Override
 public void readFields(BufferReaderWriter reader) {
   docid = reader.readString();
   creationtime = reader.readLong();
   isCandidate = reader.readBoolean();
 }