Read the record that matches this record's current key.
@param strSeekSign - Seek sign:
@return true if successful, false if not found.
@exception DBException File exception.
182820
public boolean doSeek(String strSeekSign) throws DBException
    {
        try   {
            BaseBuffer buffer = m_pTable.seek(strSeekSign, this);
            this.doSetHandle(buffer, DBConstants.DATA_SOURCE_HANDLE);
            return (buffer != null);
        } catch (DBException ex)    {
            throw DatabaseException.toDatabaseException(ex);
        }
    }
101658
public int read(BitReader bitreader) throws JSONException {
        try {
            this.width = 0;
            Symbol symbol = this.table;
            while (symbol.integer == none) {
                this.width += 1;
                symbol = bitreader.bit() ? symbol.one : symbol.zero;
            }
            tick(symbol.integer);
            if (JSONzip.probe) {
                JSONzip.logchar(symbol.integer, this.width);
            }
            return symbol.integer;
        } catch (Throwable e) {
            throw new JSONException(e);
        }
    }
296079
@Override
    public synchronized int read(final byte buf[], final int off, final int len)
            throws IOException {
        while (this.currentRecord.needsData()) {
            final byte[] data = new byte[len];
            final int read = this.inputStream.read(data);
            if (read == -1) {
                return read;
            }
            lastBuffer = ByteBuffer.wrap(data, 0, read);
            this.currentRecord.addData(lastBuffer);
        }
        final int bytesRead = this.currentRecord.drainData(buf, off, len);
        if (!this.currentRecord.hasMoreData()) {
            LOG.info("Resetting app record");
            this.currentRecord = new InputRecord(readKey);
            if (lastBuffer != null) {
                this.currentRecord.addData(lastBuffer);
            } else {
                LOG.warn("No existing buffer?");
            }
        }
        return bytesRead;
    }
1287488
public void doSet(Rec record) throws DBException
    {
        try   {
            m_objLastModBookmark = null;
            m_tableRemote.set(this.getDataSource(), record.getOpenMode());
        } catch (RemoteException ex) {
            throw new DBException(ex.getMessage());
        }
    }
903834
public int compareKeys(int iAreaDesc, String strSeekSign, FieldTable table, KeyAreaInfo keyArea)
    {
        int compareValue = super.compareKeys(iAreaDesc, strSeekSign, table, keyArea);
        if (compareValue != 0)
            return compareValue;
        if (keyArea.getUniqueKeyCode() == Constants.UNIQUE)
            return compareValue;        // Found a matching record
        if ((strSeekSign == null) || (strSeekSign.equals("==")))
        {   // looking for an exact match!
            KeyAreaInfo keyArea2 = table.getRecord().getKeyArea(Constants.MAIN_KEY_AREA);
            if (keyArea == keyArea2)
                return compareValue;        // Error? Primary key has to be unique
            compareValue = keyArea2.compareKeys(iAreaDesc);
        }
        return compareValue;
    }
894019
@Override
  @SuppressWarnings("unchecked")
  public D readRecord(@Deprecated D reuse) throws DataRecordException, IOException {
    K key = this.recordReader.createKey();
    V value = this.recordReader.createValue();
    if (this.recordReader.next(key, value)) {
      return this.readKeys ? (D) key : (D) value;
    }
    return null;
  }
1030999
protected KeyRecord getKeyRecord (int keyCode)
    {
        KeyRecord krec = _keys.get(keyCode);
        if (krec == null) {
            krec = new KeyRecord();
            _keys.put(keyCode, krec);
        }
        return krec;
    }
756670
@Override
    public Record read(Key key, ReadConsistency consistency) {
        checkNotNull(key, "key");
        checkNotNull(consistency, "consistency");

        AstyanaxTable table = (AstyanaxTable) key.getTable();
        AstyanaxStorage storage = table.getReadStorage();
        DeltaPlacement placement = (DeltaPlacement) storage.getPlacement();
        ByteBuffer rowKey = storage.getRowKey(key.getKey());

        return read(key, rowKey, consistency, placement);
    }
111408
public void readData(FieldTable table) throws DBException
    {
        if (this.getLookupKey() instanceof String)
        {
            try
            {
                FieldList record = table.getRecord();
                String strFilePath = (String)this.getLookupKey();
                String strFilePathName = this.getPDatabase().getFilename(strFilePath, false);
                File file = new File(strFilePathName);
                if (file.exists())
                {
                    XmlInOut inOut = new XmlInOut(null, null, null);
                    boolean bSuccess = inOut.importXML(((Record)record).getTable(), strFilePathName, null);
                    inOut.free();
                    if (!bSuccess)
                    {
                        // Ignore (for now)
                    }
                    this.fixCounter(table);
                }
            } catch (Exception ex) {
                ex.printStackTrace();
            }
        }
    }
569606
public boolean matches(SAMRecord record) {
    int myEnd = end == 0 ? Integer.MAX_VALUE : end;
    switch (readPositionConstraint) {
      case OVERLAPPING:
        return CoordMath.overlaps(start, myEnd, 
            record.getAlignmentStart(), record.getAlignmentEnd());
      case CONTAINED:
        return CoordMath.encloses(start, myEnd,
            record.getAlignmentStart(), record.getAlignmentEnd());
      case START_AT:
        return start == record.getAlignmentStart();
    }
    return false;
  }
928295
public T read(final K key) throws SQLException {
        return
            transactionTemplate
                .doInTransaction(new SQLFunction<Connection, T>() {
                    @Override
                    public T apply(Connection connection) throws SQLException {
                        return delegate.read(connection, key);
                    }
                });
    }
723441
private boolean isOptimisticLockingException(DbOperation failedOperation, Throwable cause) {

    boolean isConstraintViolation = ExceptionUtil.checkForeignKeyConstraintViolation(cause);
    boolean isVariableIntegrityViolation = ExceptionUtil.checkVariableIntegrityViolation(cause);

    if (isVariableIntegrityViolation) {

      return true;
    } else if (
      isConstraintViolation
      && failedOperation instanceof DbEntityOperation
      && ((DbEntityOperation) failedOperation).getEntity() instanceof HasDbReferences
      && (failedOperation.getOperationType().equals(DbOperationType.INSERT)
      || failedOperation.getOperationType().equals(DbOperationType.UPDATE))
      ) {

      DbEntity entity = ((DbEntityOperation) failedOperation).getEntity();
      for (Map.Entry<String, Class> reference : ((HasDbReferences)entity).getReferencedEntitiesIdAndClass().entrySet()) {
        DbEntity referencedEntity = this.persistenceSession.selectById(reference.getValue(), reference.getKey());
        if (referencedEntity == null) {

          return true;
        }
      }
    }

    return false;
  }
1167538
public boolean doSeek(String strSeekSign) throws DBException
    {
        m_iPhysicalIndex = NO_INDEX;    // A seek messes up the current query.
        m_iLogicalIndex = NO_INDEX;
        return super.doSeek(strSeekSign);
    }
428210
public synchronized boolean containsKey(CacheKey key) {
    Preconditions.checkNotNull(key);
    if (!mMap.containsKey(key)) {
      return false;
    }
    EncodedImage storedEncodedImage = mMap.get(key);
    synchronized (storedEncodedImage) {
      if (!EncodedImage.isValid(storedEncodedImage)) {
        // Reference is not valid, this means that someone cleared reference while it was still in
        // use. Log error
        // TODO: 3697790
        mMap.remove(key);
        FLog.w(
            TAG,
            "Found closed reference %d for key %s (%d)",
            System.identityHashCode(storedEncodedImage),
            key.getUriString(),
            System.identityHashCode(key));
        return false;
      }
      return true;
    }
  }
807853
@Override
	public StringValue readRecord(StringValue reuse, byte[] bytes, int offset, int numBytes) {
		if (this.ascii) {
			reuse.setValueAscii(bytes, offset, numBytes);
			return reuse;
		}
		else {
			ByteBuffer byteWrapper = this.byteWrapper;
			if (bytes != byteWrapper.array()) {
				byteWrapper = ByteBuffer.wrap(bytes, 0, bytes.length);
				this.byteWrapper = byteWrapper;
			}
			byteWrapper.limit(offset + numBytes);
			byteWrapper.position(offset);

			try {
				CharBuffer result = this.decoder.decode(byteWrapper);
				reuse.setValue(result);
				return reuse;
			}
			catch (CharacterCodingException e) {
				if (skipInvalidLines) {
					return null;
				} else {
					byte[] copy = new byte[numBytes];
					System.arraycopy(bytes, offset, copy, 0, numBytes);
					throw new RuntimeException("Line could not be encoded: " + Arrays.toString(copy), e);
				}
			}
		}
	}
898399
private void readTrustStore() throws IOException, FormatNotUnderstoodException {
		if (((this.hocr.getSigTruststoreFile() != null) && (!"".equals(this.hocr.getSigTruststoreFile())))) {
			LOG.info("Reading truststore to validate certificate chain for signatures");
			FlinkKeyStoreManager fksm = new FlinkKeyStoreManager();
			try {
				fksm.openKeyStore(new Path(this.hocr.getSigTruststoreFile()), this.hocr.getSigTruststoreType(),
						this.hocr.getSigTruststorePassword());
				this.hocr.setX509CertificateChain(fksm.getAllX509Certificates());
			} catch (NoSuchAlgorithmException | CertificateException | KeyStoreException | IllegalArgumentException e) {
				LOG.error("Exception: ",e);
				throw new FormatNotUnderstoodException(
						"Cannot read truststore to establish certificate chain for signature validation " + e);
			}

		}
	}
347579
boolean hasNext() throws DataSourceReadException {
        if (!hasNextComputed) {
            boolean stayInLoop;
            do {
                stayInLoop = false;
                /*
                 * Prior to reading the first iterator, we loop through all of
                 * the iterators to determine the minimum keyId. The minimum
                 * keyId, stored in currentMin, is used for data retrieval. The
                 * value of currentMin will be null if there is no data to
                 * retrieve.
                 */
                if (i == 0) {
                    this.currentMin = null;
                    for (DataStreamingEvent<E> elt : this.currentElt) {
                        currentMin = min(elt);
                    }
                }
                /*
                 * If there is no data to retrieve, we'll return false. If there
                 * is data to retrieve, we'll loop through the iterators and
                 * pull data for the current keyId, which is the keyId field of
                 * currentMin. If there's no data for the current keyId, this
                 * should loop through all of the iterators until their ends,
                 * and set hasNext to false.
                 */
                if (currentMin == null) {
                    this.hasNext = false;
                } else {
                    int n = this.currentElt.size();
                    for (; i < n; i++) {
                        DataStreamingEvent<E> elt = this.currentElt.get(i);
                        if (elt != null && elt.getKeyId().equals(
                                this.currentMin != null 
                                ? this.currentMin.getKeyId() : null)) {
                            this.result = elt;
                            this.nextKeyId = elt.getKeyId();
                            advance(i);
                            i++;
                            break;
                        }
                    }
                    if (this.i == n && this.result == null) {
                        this.i = 0;
                        stayInLoop = true;
                    }
                }
            } while (this.hasNext && stayInLoop);
            this.hasNextComputed = true;
        }
        return hasNext;
    }