本文整理了Java中org.apache.hadoop.record.Utils.getVIntSize()
方法的一些代码示例,展示了Utils.getVIntSize()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Utils.getVIntSize()
方法的具体详情如下:
包路径:org.apache.hadoop.record.Utils
类名称:Utils
方法名:getVIntSize
[英]Get the encoded length if an integer is stored in a variable-length format
[中]如果整数以可变长度格式存储,则获取编码长度
代码示例来源:origin: org.apache.hadoop/hadoop-common-test
static public int slurpRaw(byte[] b, int s, int l) {
try {
int os = s;
{
int i = org.apache.hadoop.record.Utils.readVInt(b, s);
int z = org.apache.hadoop.record.Utils.getVIntSize(i);
s += z+i; l -= (z+i);
}
return (os - s);
} catch(java.io.IOException e) {
throw new RuntimeException(e);
}
}
static public int compareRaw(byte[] b1, int s1, int l1,
代码示例来源:origin: org.apache.hadoop/hadoop-common-test
static public int slurpRaw(byte[] b, int s, int l) {
try {
int os = s;
{
int i = org.apache.hadoop.record.Utils.readVInt(b, s);
int z = org.apache.hadoop.record.Utils.getVIntSize(i);
s+=(z+i); l-= (z+i);
}
return (os - s);
} catch(java.io.IOException e) {
throw new RuntimeException(e);
}
}
static public int compareRaw(byte[] b1, int s1, int l1,
代码示例来源:origin: org.apache.hadoop/hadoop-common-test
static public int slurpRaw(byte[] b, int s, int l) {
try {
int os = s;
{
int i = org.apache.hadoop.record.Utils.readVInt(b, s);
int z = org.apache.hadoop.record.Utils.getVIntSize(i);
s+=(z+i); l-= (z+i);
}
return (os - s);
} catch(java.io.IOException e) {
throw new RuntimeException(e);
}
}
static public int compareRaw(byte[] b1, int s1, int l1,
代码示例来源:origin: org.apache.hadoop/hadoop-common-test
static public int slurpRaw(byte[] b, int s, int l) {
try {
int os = s;
{
int i = org.apache.hadoop.record.Utils.readVInt(b, s);
int z = org.apache.hadoop.record.Utils.getVIntSize(i);
s+=z; l-=z;
}
return (os - s);
} catch(java.io.IOException e) {
throw new RuntimeException(e);
}
}
static public int compareRaw(byte[] b1, int s1, int l1,
代码示例来源:origin: dnmilne/wikipediaminer
static public int slurpRaw(byte[] b, int s, int l) {
try {
int os = s;
{
int i = org.apache.hadoop.record.Utils.readVInt(b, s);
int z = org.apache.hadoop.record.Utils.getVIntSize(i);
s+=z; l-=z;
}
{
int i = org.apache.hadoop.record.Utils.readVInt(b, s);
int z = org.apache.hadoop.record.Utils.getVIntSize(i);
s+=z; l-=z;
}
return (os - s);
} catch(java.io.IOException e) {
throw new RuntimeException(e);
}
}
static public int compareRaw(byte[] b1, int s1, int l1,
代码示例来源:origin: dnmilne/wikipediaminer
static public int slurpRaw(byte[] b, int s, int l) {
try {
int os = s;
{
int vi1 = org.apache.hadoop.record.Utils.readVInt(b, s);
int vz1 = org.apache.hadoop.record.Utils.getVIntSize(vi1);
s+=vz1; l-=vz1;
for (int vidx1 = 0; vidx1 < vi1; vidx1++){
int i = org.apache.hadoop.record.Utils.readVInt(b, s);
int z = org.apache.hadoop.record.Utils.getVIntSize(i);
s+=z; l-=z;
}
}
return (os - s);
} catch(java.io.IOException e) {
throw new RuntimeException(e);
}
}
static public int compareRaw(byte[] b1, int s1, int l1,
代码示例来源:origin: kermitt2/entity-fishing
static public int slurpRaw(byte[] b, int s, int l) {
try {
int os = s;
{
int vi1 = org.apache.hadoop.record.Utils.readVInt(b, s);
int vz1 = org.apache.hadoop.record.Utils.getVIntSize(vi1);
s+=vz1; l-=vz1;
for (int vidx1 = 0; vidx1 < vi1; vidx1++){
int i = org.apache.hadoop.record.Utils.readVInt(b, s);
int z = org.apache.hadoop.record.Utils.getVIntSize(i);
s+=z; l-=z;
}
}
return (os - s);
} catch(java.io.IOException e) {
throw new RuntimeException(e);
}
}
static public int compareRaw(byte[] b1, int s1, int l1,
代码示例来源:origin: org.apache.hadoop/hadoop-common-test
static public int compareRaw(byte[] b1, int s1, int l1,
byte[] b2, int s2, int l2) {
try {
int os1 = s1;
{
int i1 = org.apache.hadoop.record.Utils.readVInt(b1, s1);
int i2 = org.apache.hadoop.record.Utils.readVInt(b2, s2);
if (i1 != i2) {
return ((i1-i2) < 0) ? -1 : 0;
}
int z1 = org.apache.hadoop.record.Utils.getVIntSize(i1);
int z2 = org.apache.hadoop.record.Utils.getVIntSize(i2);
s1+=z1; s2+=z2; l1-=z1; l2-=z2;
}
return (os1 - s1);
} catch(java.io.IOException e) {
throw new RuntimeException(e);
}
}
public int compare(byte[] b1, int s1, int l1,
代码示例来源:origin: dnmilne/wikipediaminer
static public int slurpRaw(byte[] b, int s, int l) {
try {
int os = s;
{
int vi1 = org.apache.hadoop.record.Utils.readVInt(b, s);
int vz1 = org.apache.hadoop.record.Utils.getVIntSize(vi1);
s+=vz1; l-=vz1;
for (int vidx1 = 0; vidx1 < vi1; vidx1++){
int i = org.apache.hadoop.record.Utils.readVInt(b, s);
int z = org.apache.hadoop.record.Utils.getVIntSize(i);
s+=z; l-=z;
}
}
return (os - s);
} catch(java.io.IOException e) {
throw new RuntimeException(e);
}
}
static public int compareRaw(byte[] b1, int s1, int l1,
代码示例来源:origin: kermitt2/entity-fishing
static public int slurpRaw(byte[] b, int s, int l) {
try {
int os = s;
{
int vi1 = org.apache.hadoop.record.Utils.readVInt(b, s);
int vz1 = org.apache.hadoop.record.Utils.getVIntSize(vi1);
s+=vz1; l-=vz1;
for (int vidx1 = 0; vidx1 < vi1; vidx1++){
int i = org.apache.hadoop.record.Utils.readVInt(b, s);
int z = org.apache.hadoop.record.Utils.getVIntSize(i);
s+=z; l-=z;
}
}
return (os - s);
} catch(java.io.IOException e) {
throw new RuntimeException(e);
}
}
static public int compareRaw(byte[] b1, int s1, int l1,
代码示例来源:origin: kermitt2/entity-fishing
static public int slurpRaw(byte[] b, int s, int l) {
try {
int os = s;
{
int i = org.apache.hadoop.record.Utils.readVInt(b, s);
int z = org.apache.hadoop.record.Utils.getVIntSize(i);
s+=z; l-=z;
}
{
int i = org.apache.hadoop.record.Utils.readVInt(b, s);
int z = org.apache.hadoop.record.Utils.getVIntSize(i);
s+=z; l-=z;
}
return (os - s);
} catch(java.io.IOException e) {
throw new RuntimeException(e);
}
}
static public int compareRaw(byte[] b1, int s1, int l1,
代码示例来源:origin: apache/chukwa
static public int slurpRaw(byte[] b, int s, int l) {
try {
int os = s;
{
int i = org.apache.hadoop.record.Utils.readVInt(b, s);
int z = org.apache.hadoop.record.Utils.getVIntSize(i);
s += (z + i);
l -= (z + i);
}
{
int i = org.apache.hadoop.record.Utils.readVInt(b, s);
int z = org.apache.hadoop.record.Utils.getVIntSize(i);
s += (z + i);
l -= (z + i);
}
return (os - s);
} catch (java.io.IOException e) {
throw new RuntimeException(e);
}
}
代码示例来源:origin: org.apache.hadoop/hadoop-common-test
static public int compareRaw(byte[] b1, int s1, int l1,
byte[] b2, int s2, int l2) {
try {
int os1 = s1;
{
int i1 = org.apache.hadoop.record.Utils.readVInt(b1, s1);
int i2 = org.apache.hadoop.record.Utils.readVInt(b2, s2);
int z1 = org.apache.hadoop.record.Utils.getVIntSize(i1);
int z2 = org.apache.hadoop.record.Utils.getVIntSize(i2);
s1+=z1; s2+=z2; l1-=z1; l2-=z2;
int r1 = org.apache.hadoop.record.Utils.compareBytes(b1,s1,i1,b2,s2,i2);
if (r1 != 0) { return (r1<0)?-1:0; }
s1+=i1; s2+=i2; l1-=i1; l1-=i2;
}
return (os1 - s1);
} catch(java.io.IOException e) {
throw new RuntimeException(e);
}
}
public int compare(byte[] b1, int s1, int l1,
代码示例来源:origin: org.apache.hadoop/hadoop-common-test
static public int compareRaw(byte[] b1, int s1, int l1,
byte[] b2, int s2, int l2) {
try {
int os1 = s1;
{
int i1 = org.apache.hadoop.record.Utils.readVInt(b1, s1);
int i2 = org.apache.hadoop.record.Utils.readVInt(b2, s2);
int z1 = org.apache.hadoop.record.Utils.getVIntSize(i1);
int z2 = org.apache.hadoop.record.Utils.getVIntSize(i2);
s1+=z1; s2+=z2; l1-=z1; l2-=z2;
int r1 = org.apache.hadoop.record.Utils.compareBytes(b1,s1,i1,b2,s2,i2);
if (r1 != 0) { return (r1<0)?-1:0; }
s1+=i1; s2+=i2; l1-=i1; l1-=i2;
}
return (os1 - s1);
} catch(java.io.IOException e) {
throw new RuntimeException(e);
}
}
public int compare(byte[] b1, int s1, int l1,
代码示例来源:origin: org.apache.hadoop/hadoop-common-test
static public int compareRaw(byte[] b1, int s1, int l1,
byte[] b2, int s2, int l2) {
try {
int os1 = s1;
{
int i1 = org.apache.hadoop.record.Utils.readVInt(b1, s1);
int i2 = org.apache.hadoop.record.Utils.readVInt(b2, s2);
int z1 = org.apache.hadoop.record.Utils.getVIntSize(i1);
int z2 = org.apache.hadoop.record.Utils.getVIntSize(i2);
s1+=z1; s2+=z2; l1-=z1; l2-=z2;
int r1 = org.apache.hadoop.record.Utils.compareBytes(b1,s1,i1,b2,s2,i2);
if (r1 != 0) { return (r1<0)?-1:0; }
s1+=i1; s2+=i2; l1-=i1; l1-=i2;
}
return (os1 - s1);
} catch(java.io.IOException e) {
throw new RuntimeException(e);
}
}
public int compare(byte[] b1, int s1, int l1,
代码示例来源:origin: kermitt2/entity-fishing
static public int compareRaw(byte[] b1, int s1, int l1,
byte[] b2, int s2, int l2) {
try {
int os1 = s1;
{
int vi11 = org.apache.hadoop.record.Utils.readVInt(b1, s1);
int vi21 = org.apache.hadoop.record.Utils.readVInt(b2, s2);
int vz11 = org.apache.hadoop.record.Utils.getVIntSize(vi11);
int vz21 = org.apache.hadoop.record.Utils.getVIntSize(vi21);
s1+=vz11; s2+=vz21; l1-=vz11; l2-=vz21;
for (int vidx1 = 0; vidx1 < vi11 && vidx1 < vi21; vidx1++){
int r1 = com.scienceminer.nerd.kb.model.hadoop.DbLabelForPage.Comparator.compareRaw(b1,s1,l1,b2,s2,l2);
if (r1 <= 0) { return r1; }
s1+=r1; s2+=r1; l1-=r1; l2-=r1;
}
if (vi11 != vi21) { return (vi11<vi21)?-1:0; }
}
return (os1 - s1);
} catch(java.io.IOException e) {
throw new RuntimeException(e);
}
}
public int compare(byte[] b1, int s1, int l1,
代码示例来源:origin: dnmilne/wikipediaminer
static public int slurpRaw(byte[] b, int s, int l) {
try {
int os = s;
{
int vi1 = org.apache.hadoop.record.Utils.readVInt(b, s);
int vz1 = org.apache.hadoop.record.Utils.getVIntSize(vi1);
s+=vz1; l-=vz1;
for (int vidx1 = 0; vidx1 < vi1; vidx1++){
int r = org.wikipedia.miner.db.struct.DbLabelForPage.Comparator.slurpRaw(b,s,l);
s+=r; l-=r;
}
}
return (os - s);
} catch(java.io.IOException e) {
throw new RuntimeException(e);
}
}
static public int compareRaw(byte[] b1, int s1, int l1,
代码示例来源:origin: kermitt2/entity-fishing
static public int slurpRaw(byte[] b, int s, int l) {
try {
int os = s;
{
int vi1 = org.apache.hadoop.record.Utils.readVInt(b, s);
int vz1 = org.apache.hadoop.record.Utils.getVIntSize(vi1);
s+=vz1; l-=vz1;
for (int vidx1 = 0; vidx1 < vi1; vidx1++){
int r = com.scienceminer.nerd.kb.model.hadoop.DbLabelForPage.Comparator.slurpRaw(b,s,l);
s+=r; l-=r;
}
}
return (os - s);
} catch(java.io.IOException e) {
throw new RuntimeException(e);
}
}
static public int compareRaw(byte[] b1, int s1, int l1,
代码示例来源:origin: dnmilne/wikipediaminer
static public int slurpRaw(byte[] b, int s, int l) {
try {
int os = s;
{
int vi1 = org.apache.hadoop.record.Utils.readVInt(b, s);
int vz1 = org.apache.hadoop.record.Utils.getVIntSize(vi1);
s+=vz1; l-=vz1;
for (int vidx1 = 0; vidx1 < vi1; vidx1++){
int r = org.wikipedia.miner.db.struct.DbLinkLocation.Comparator.slurpRaw(b,s,l);
s+=r; l-=r;
}
}
return (os - s);
} catch(java.io.IOException e) {
throw new RuntimeException(e);
}
}
static public int compareRaw(byte[] b1, int s1, int l1,
代码示例来源:origin: kermitt2/entity-fishing
static public int slurpRaw(byte[] b, int s, int l) {
try {
int os = s;
{
int vi1 = org.apache.hadoop.record.Utils.readVInt(b, s);
int vz1 = org.apache.hadoop.record.Utils.getVIntSize(vi1);
s+=vz1; l-=vz1;
for (int vidx1 = 0; vidx1 < vi1; vidx1++){
int r = com.scienceminer.nerd.kb.model.hadoop.DbLinkLocation.Comparator.slurpRaw(b,s,l);
s+=r; l-=r;
}
}
return (os - s);
} catch(java.io.IOException e) {
throw new RuntimeException(e);
}
}
static public int compareRaw(byte[] b1, int s1, int l1,
内容来源于网络,如有侵权,请联系作者删除!