Codota Logo
ProtobufMagic.lengthOfPBMagic
Code IndexAdd Codota 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)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Gson g =
  • Codota Iconnew Gson()
  • Codota IconGsonBuilder gsonBuilder;gsonBuilder.create()
  • Codota Iconnew GsonBuilder().create()
  • Smart code suggestions by Codota
}
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
  • scheduleAtFixedRate (Timer)
  • getSupportFragmentManager (FragmentActivity)
    Return the FragmentManager for interacting with fragments associated with this activity.
  • requestLocationUpdates (LocationManager)
  • Socket (java.net)
    Provides a client-side TCP socket.
  • DecimalFormat (java.text)
    DecimalFormat is a concrete subclass ofNumberFormat that formats decimal numbers. It has a variety o
  • Arrays (java.util)
    This class contains various methods for manipulating arrays (such as sorting and searching). This cl
  • ThreadPoolExecutor (java.util.concurrent)
    An ExecutorService that executes each submitted task using one of possibly several pooled threads, n
  • JButton (javax.swing)
  • Join (org.hibernate.mapping)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now