Tabnine Logo
ProtobufMagic.lengthOfPBMagic
Code IndexAdd Tabnine to your IDE (free)

How to use
lengthOfPBMagic
method
in
org.apache.hadoop.hbase.protobuf.ProtobufMagic

Best Java code snippets using org.apache.hadoop.hbase.protobuf.ProtobufMagic.lengthOfPBMagic (Showing top 16 results out of 315)

origin: apache/hbase

/**
 * @return Length of {@link ProtobufMagic#lengthOfPBMagic()}
 */
public static int lengthOfPBMagic() {
 return ProtobufMagic.lengthOfPBMagic();
}
origin: apache/hbase

/**
 * @return Length of {@link ProtobufMagic#lengthOfPBMagic()}
 */
public static int lengthOfPBMagic() {
 return ProtobufMagic.lengthOfPBMagic();
}
origin: apache/hbase

protected static Quotas quotasFromData(
  final byte[] data, int offset, int length) throws IOException {
 int magicLen = ProtobufMagic.lengthOfPBMagic();
 if (!ProtobufMagic.isPBMagicPrefix(data, offset, magicLen)) {
  throw new IOException("Missing pb magic prefix");
 }
 return Quotas.parseFrom(new ByteArrayInputStream(data, offset + magicLen, length - magicLen));
}
origin: apache/hbase

/**
 * @see #persistToFile()
 */
private void retrieveFromFile(int[] bucketSizes) throws IOException {
 File persistenceFile = new File(persistencePath);
 if (!persistenceFile.exists()) {
  return;
 }
 assert !cacheEnabled;
 try (FileInputStream in = deleteFileOnClose(persistenceFile)) {
  int pblen = ProtobufMagic.lengthOfPBMagic();
  byte[] pbuf = new byte[pblen];
  int read = in.read(pbuf);
  if (read != pblen) {
   throw new IOException("Incorrect number of bytes read while checking for protobuf magic "
     + "number. Requested=" + pblen + ", Received= " + read + ", File=" + persistencePath);
  }
  if (! ProtobufMagic.isPBMagicPrefix(pbuf)) {
   // In 3.0 we have enough flexibility to dump the old cache data.
   // TODO: In 2.x line, this might need to be filled in to support reading the old format
   throw new IOException("Persistence file does not start with protobuf magic number. " +
     persistencePath);
  }
  parsePB(BucketCacheProtos.BucketCacheEntry.parseDelimitedFrom(in));
  bucketAllocator = new BucketAllocator(cacheCapacity, bucketSizes, backingMap, realCacheSize);
 }
}
origin: apache/hbase

if (data == null || data.length <= 0) return null;
if (ProtobufMagic.isPBMagicPrefix(data)) {
 int prefixLen = ProtobufMagic.lengthOfPBMagic();
 try {
  ZooKeeperProtos.Master rss =
origin: org.apache.hbase/hbase-client

/**
 * @return Length of {@link ProtobufMagic#lengthOfPBMagic()}
 */
public static int lengthOfPBMagic() {
 return ProtobufMagic.lengthOfPBMagic();
}
origin: apache/hbase

if (data == null || data.length <= 0) return null;
if (ProtobufMagic.isPBMagicPrefix(data)) {
 int prefixLen = ProtobufMagic.lengthOfPBMagic();
 try {
  ZooKeeperProtos.Master rss =
origin: org.apache.hbase/hbase-client

/**
 * @return Length of {@link ProtobufMagic#lengthOfPBMagic()}
 */
public static int lengthOfPBMagic() {
 return ProtobufMagic.lengthOfPBMagic();
}
origin: org.apache.hbase/hbase-client

protected static Quotas quotasFromData(
  final byte[] data, int offset, int length) throws IOException {
 int magicLen = ProtobufMagic.lengthOfPBMagic();
 if (!ProtobufMagic.isPBMagicPrefix(data, offset, magicLen)) {
  throw new IOException("Missing pb magic prefix");
 }
 return Quotas.parseFrom(new ByteArrayInputStream(data, offset + magicLen, length - magicLen));
}
origin: org.apache.hbase/hbase-client

if (data == null || data.length <= 0) return null;
if (ProtobufMagic.isPBMagicPrefix(data)) {
 int prefixLen = ProtobufMagic.lengthOfPBMagic();
 try {
  ZooKeeperProtos.Master rss =
origin: com.aliyun.hbase/alihbase-client

/**
 * @return Length of {@link ProtobufMagic#lengthOfPBMagic()}
 */
public static int lengthOfPBMagic() {
 return ProtobufMagic.lengthOfPBMagic();
}
origin: com.aliyun.hbase/alihbase-client

/**
 * @return Length of {@link ProtobufMagic#lengthOfPBMagic()}
 */
public static int lengthOfPBMagic() {
 return ProtobufMagic.lengthOfPBMagic();
}
origin: org.apache.hbase/hbase-client

if (data == null || data.length <= 0) return null;
if (ProtobufMagic.isPBMagicPrefix(data)) {
 int prefixLen = ProtobufMagic.lengthOfPBMagic();
 try {
  ZooKeeperProtos.Master rss =
origin: com.aliyun.hbase/alihbase-client

protected static Quotas quotasFromData(
  final byte[] data, int offset, int length) throws IOException {
 int magicLen = ProtobufMagic.lengthOfPBMagic();
 if (!ProtobufMagic.isPBMagicPrefix(data, offset, magicLen)) {
  throw new IOException("Missing pb magic prefix");
 }
 return Quotas.parseFrom(new ByteArrayInputStream(data, offset + magicLen, length - magicLen));
}
origin: com.aliyun.hbase/alihbase-client

if (data == null || data.length <= 0) return null;
if (ProtobufMagic.isPBMagicPrefix(data)) {
 int prefixLen = ProtobufMagic.lengthOfPBMagic();
 try {
  ZooKeeperProtos.Master rss =
origin: com.aliyun.hbase/alihbase-client

if (data == null || data.length <= 0) return null;
if (ProtobufMagic.isPBMagicPrefix(data)) {
 int prefixLen = ProtobufMagic.lengthOfPBMagic();
 try {
  ZooKeeperProtos.Master rss =
org.apache.hadoop.hbase.protobufProtobufMagiclengthOfPBMagic

Popular methods of ProtobufMagic

  • isPBMagicPrefix
  • compareTo

Popular in Java

  • Creating JSON documents from java classes using gson
  • onRequestPermissionsResult (Fragment)
  • scheduleAtFixedRate (Timer)
  • getExternalFilesDir (Context)
  • Font (java.awt)
    The Font class represents fonts, which are used to render text in a visible way. A font provides the
  • BigInteger (java.math)
    An immutable arbitrary-precision signed integer.FAST CRYPTOGRAPHY This implementation is efficient f
  • SocketException (java.net)
    This SocketException may be thrown during socket creation or setting options, and is the superclass
  • Date (java.sql)
    A class which can consume and produce dates in SQL Date format. Dates are represented in SQL as yyyy
  • MessageFormat (java.text)
    Produces concatenated messages in language-neutral way. New code should probably use java.util.Forma
  • Manifest (java.util.jar)
    The Manifest class is used to obtain attribute information for a JarFile and its entries.
  • Top PhpStorm 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