You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pig.apache.org by Apache Wiki <wi...@apache.org> on 2010/01/28 10:23:00 UTC
[Pig Wiki] Trivial Update of "PigMemory" by newacct
Dear Wiki user,
You have subscribed to a wiki page or wiki category on "Pig Wiki" for change notification.
The "PigMemory" page has been changed by newacct.
http://wiki.apache.org/pig/PigMemory?action=diff&rev1=4&rev2=5
--------------------------------------------------
static int bufferSize;
static {
- String bufsize = System.getProperties().getProperty("pig.memory.databuffer.size", "10240");
+ String bufsize = System.getProperty("pig.memory.databuffer.size", "10240");
- bufferSize = Integer.valueOf(bufsize) * 1024;
+ bufferSize = Integer.parseInt(bufsize) * 1024;
}
byte[bufferSize] data;
@@ -260, +260 @@
* then use it, otherwise create a new one.
*/
TupleBuffer getTupleBuffer() {
- if (availableTupleBuffers.size() > 0) {
+ if (!availableTupleBuffers.isEmpty()) {
return availableTupleBuffers.iterator().getNext();
} else {
TupleBuffer tb = new TupleBuffer();
@@ -276, +276 @@
* an existing full TupleBuffer to flush and then use its DataBuffer.
*/
DataBuffer getDataBuffer() {
- if (availableDataBuffers.size() > 0) {
+ if (!availableDataBuffers.isEmpty()) {
return availableDataBuffers.pop();
} else {
if (numCreatedDataBuffers < maxDataBuffers) {
@@ -305, +305 @@
TupleBuffer buf;
// Offsets into the tuple buffer for each field. A negative value
- // indicates that the field is a complex type, and the absoluate value
+ // indicates that the field is a complex type, and the absolute value
// yields the offsets into the complexFields array. This is stored
// as an array to avoid the overhead of an ArrayList.
private int[] fieldOffsets;
// Array of complex fields (tuples, bags, maps) in this tuple. Stored
- // as an aray to avoid the overhead of an array list.
+ // as an array to avoid the overhead of an array list.
private Object[] complexFields;
// Do not add any more member variables. We want to keep the memory