Tabnine Logo
BlobKey.equals
Code IndexAdd Tabnine to your IDE (free)

How to use
equals
method
in
org.apache.flink.runtime.blob.BlobKey

Best Java code snippets using org.apache.flink.runtime.blob.BlobKey.equals (Showing top 3 results out of 315)

origin: org.apache.flink/flink-runtime_2.10

@Override
public int read() throws IOException {
  if (this.bytesReceived == this.bytesToReceive) {
    return -1;
  }
  final int read = this.wrappedInputStream.read();
  if (read < 0) {
    throwEOFException();
  }
  ++this.bytesReceived;
  if (this.md != null) {
    this.md.update((byte) read);
    if (this.bytesReceived == this.bytesToReceive) {
      final BlobKey computedKey = new BlobKey(this.md.digest());
      if (!computedKey.equals(this.blobKey)) {
        throw new IOException("Detected data corruption during transfer");
      }
    }
  }
  return read;
}
origin: org.apache.flink/flink-runtime_2.10

@Override
public int read(byte[] b, int off, int len) throws IOException {
  final int bytesMissing = this.bytesToReceive - this.bytesReceived;
  if (bytesMissing == 0) {
    return -1;
  }
  final int maxRecv = Math.min(len, bytesMissing);
  final int read = this.wrappedInputStream.read(b, off, maxRecv);
  if (read < 0) {
    throwEOFException();
  }
  this.bytesReceived += read;
  if (this.md != null) {
    this.md.update(b, off, read);
    if (this.bytesReceived == this.bytesToReceive) {
      final BlobKey computedKey = new BlobKey(this.md.digest());
      if (!computedKey.equals(this.blobKey)) {
        throw new IOException("Detected data corruption during transfer");
      }
    }
  }
  return read;
}
origin: org.apache.flink/flink-runtime_2.10

private BlobKey receivePutResponseAndCompare(InputStream is, MessageDigest md) throws IOException {
  int response = is.read();
  if (response < 0) {
    throw new EOFException("Premature end of response");
  }
  else if (response == RETURN_OKAY) {
    if (md == null) {
      // not content addressable
      return null;
    }
    BlobKey remoteKey = BlobKey.readFromInputStream(is);
    BlobKey localKey = new BlobKey(md.digest());
    if (!localKey.equals(remoteKey)) {
      throw new IOException("Detected data corruption during transfer");
    }
    return localKey;
  }
  else if (response == RETURN_ERROR) {
    Throwable cause = readExceptionFromStream(is);
    throw new IOException("Server side error: " + cause.getMessage(), cause);
  }
  else {
    throw new IOException("Unrecognized response: " + response + '.');
  }
}
org.apache.flink.runtime.blobBlobKeyequals

Popular methods of BlobKey

  • readFromInputStream
    Auxiliary method to read a BLOB key from an input stream.
  • toString
  • writeToOutputStream
    Auxiliary method to write this BLOB key to an output stream.
  • createKey
    Returns the right BlobKey subclass for the given parameters.
  • getHash
    Returns the hash component of this key.
  • getType
    Returns the (internal) BLOB type which is reflected by the inheriting sub-class.
  • <init>
    Constructs a new BLOB key from the given byte array.

Popular in Java

  • Making http post requests using okhttp
  • setRequestProperty (URLConnection)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • scheduleAtFixedRate (Timer)
  • ObjectMapper (com.fasterxml.jackson.databind)
    ObjectMapper provides functionality for reading and writing JSON, either to and from basic POJOs (Pl
  • IOException (java.io)
    Signals a general, I/O-related error. Error details may be specified when calling the constructor, a
  • String (java.lang)
  • Pattern (java.util.regex)
    Patterns are compiled regular expressions. In many cases, convenience methods such as String#matches
  • Cipher (javax.crypto)
    This class provides access to implementations of cryptographic ciphers for encryption and decryption
  • LogFactory (org.apache.commons.logging)
    Factory for creating Log instances, with discovery and configuration features similar to that employ
  • Top Sublime Text plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now