本文整理了Java中org.apache.hadoop.record.Buffer.setCapacity()
方法的一些代码示例,展示了Buffer.setCapacity()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Buffer.setCapacity()
方法的具体详情如下:
包路径:org.apache.hadoop.record.Buffer
类名称:Buffer
方法名:setCapacity
[英]Change the capacity of the backing storage. The data is preserved if newCapacity >= getCount().
[中]更改备份存储器的容量。如果newCapacity>=getCount(),则数据将被保留。
代码示例来源:origin: com.facebook.hadoop/hadoop-core
/**
* Reset the buffer to 0 size
*/
public void reset() {
setCapacity(0);
}
代码示例来源:origin: io.hops/hadoop-common
/**
* Change the capacity of the backing store to be the same as the current
* count of buffer.
*/
public void truncate() {
setCapacity(count);
}
代码示例来源:origin: org.jvnet.hudson.hadoop/hadoop-core
/**
* Reset the buffer to 0 size
*/
public void reset() {
setCapacity(0);
}
代码示例来源:origin: org.apache.hadoop/hadoop-streaming
/**
* Reset the buffer to 0 size
*/
public void reset() {
setCapacity(0);
}
代码示例来源:origin: ch.cern.hadoop/hadoop-common
/**
* Change the capacity of the backing store to be the same as the current
* count of buffer.
*/
public void truncate() {
setCapacity(count);
}
代码示例来源:origin: io.hops/hadoop-common
/**
* Reset the buffer to 0 size
*/
public void reset() {
setCapacity(0);
}
代码示例来源:origin: org.apache.hadoop/hadoop-streaming
/**
* Change the capacity of the backing store to be the same as the current
* count of buffer.
*/
public void truncate() {
setCapacity(count);
}
代码示例来源:origin: com.github.jiayuhan-it/hadoop-common
/**
* Reset the buffer to 0 size
*/
public void reset() {
setCapacity(0);
}
代码示例来源:origin: io.prestosql.hadoop/hadoop-apache
/**
* Change the capacity of the backing store to be the same as the current
* count of buffer.
*/
public void truncate() {
setCapacity(count);
}
代码示例来源:origin: ch.cern.hadoop/hadoop-common
/**
* Reset the buffer to 0 size
*/
public void reset() {
setCapacity(0);
}
代码示例来源:origin: com.github.jiayuhan-it/hadoop-common
/**
* Change the capacity of the backing store to be the same as the current
* count of buffer.
*/
public void truncate() {
setCapacity(count);
}
代码示例来源:origin: com.facebook.hadoop/hadoop-core
/**
* Change the capacity of the backing store to be the same as the current
* count of buffer.
*/
public void truncate() {
setCapacity(count);
}
代码示例来源:origin: com.github.jiayuhan-it/hadoop-common
/**
* Append specified bytes to the buffer.
*
* @param bytes byte array to be appended
* @param offset offset into byte array
* @param length length of data
*/
public void append(byte[] bytes, int offset, int length) {
setCapacity(count+length);
System.arraycopy(bytes, offset, this.get(), count, length);
count = count + length;
}
代码示例来源:origin: io.hops/hadoop-common
/**
* Append specified bytes to the buffer.
*
* @param bytes byte array to be appended
* @param offset offset into byte array
* @param length length of data
*/
public void append(byte[] bytes, int offset, int length) {
setCapacity(count+length);
System.arraycopy(bytes, offset, this.get(), count, length);
count = count + length;
}
代码示例来源:origin: org.apache.hadoop/hadoop-streaming
/**
* Append specified bytes to the buffer.
*
* @param bytes byte array to be appended
* @param offset offset into byte array
* @param length length of data
*/
public void append(byte[] bytes, int offset, int length) {
setCapacity(count+length);
System.arraycopy(bytes, offset, this.get(), count, length);
count = count + length;
}
代码示例来源:origin: io.prestosql.hadoop/hadoop-apache
/**
* Append specified bytes to the buffer.
*
* @param bytes byte array to be appended
* @param offset offset into byte array
* @param length length of data
*/
public void append(byte[] bytes, int offset, int length) {
setCapacity(count+length);
System.arraycopy(bytes, offset, this.get(), count, length);
count = count + length;
}
代码示例来源:origin: ch.cern.hadoop/hadoop-common
/**
* Append specified bytes to the buffer.
*
* @param bytes byte array to be appended
* @param offset offset into byte array
* @param length length of data
*/
public void append(byte[] bytes, int offset, int length) {
setCapacity(count+length);
System.arraycopy(bytes, offset, this.get(), count, length);
count = count + length;
}
代码示例来源:origin: com.facebook.hadoop/hadoop-core
/**
* Append specified bytes to the buffer.
*
* @param bytes byte array to be appended
* @param offset offset into byte array
* @param length length of data
*/
public void append(byte[] bytes, int offset, int length) {
setCapacity(count+length);
System.arraycopy(bytes, offset, this.get(), count, length);
count = count + length;
}
代码示例来源:origin: org.apache.hadoop/hadoop-common-test
/**
* Test of getCapacity method, of class org.apache.hadoop.record.Buffer.
*/
public void testGetCapacity() {
final Buffer instance = new Buffer();
final int expResult = 0;
final int result = instance.getCapacity();
assertEquals("getCapacity failed", expResult, result);
instance.setCapacity(100);
assertEquals("setCapacity failed", 100, instance.getCapacity());
}
代码示例来源:origin: org.apache.hadoop/hadoop-common-test
/**
* Test of truncate method, of class org.apache.hadoop.record.Buffer.
*/
public void testTruncate() {
final Buffer instance = new Buffer();
instance.setCapacity(100);
assertEquals("setCapacity failed", 100, instance.getCapacity());
instance.truncate();
assertEquals("truncate failed", 0, instance.getCapacity());
}
内容来源于网络,如有侵权,请联系作者删除!