1 8 package org.ozoneDB.core.storage.gammaStore; 9 10 import java.io.Serializable ; 11 12 16 public class NodeIdLoc extends Loc { 17 18 protected long[] nodeIds; 19 20 public NodeIdLoc(int capacity, float bufferFactor) { 21 super(capacity, bufferFactor); 22 nodeIds = new long[keys.length]; 23 } 24 25 public NodeIdLoc(int capacity, int slack) { 26 super(capacity, slack); 27 nodeIds = new long[keys.length]; 28 } 29 30 public void putNodeId(int pos, long nodeId) { 31 nodeIds[pos] = nodeId; 32 } 33 34 protected void move(int from, int to) { 35 super.move(from, to); 36 nodeIds[to] = nodeIds[from]; 37 } 38 39 public long getNodeId(int pos) { 40 return nodeIds[pos]; 41 } 42 43 public String toString() { 44 StringBuffer result = new StringBuffer (super.toString()); 45 result.append(" nodes ["); 46 for (int i = 0; i < nodeIds.length; i++) { 47 result.append(nodeIds[i]); 48 if (!isInUse(i)) { 49 result.append("D"); 50 } 51 if (i < nodeIds.length - 1) { 52 result.append(", "); 53 } else { 54 result.append("]"); 55 } 56 } 57 58 return result.toString(); 59 } 60 61 } 62 | Popular Tags |