use of org.apache.hyracks.dataflow.common.comm.util.ByteBufferInputStream in project asterixdb by apache.
the class FrameDebugUtils method prettyPrint.
/**
* Debugging method
* @param fta
* @param recordDescriptor
* @param prefix
*/
public void prettyPrint(IFrameTupleAccessor fta, RecordDescriptor recordDescriptor, String prefix) {
try (ByteBufferInputStream bbis = new ByteBufferInputStream();
DataInputStream dis = new DataInputStream(bbis)) {
int tc = fta.getTupleCount();
StringBuilder sb = new StringBuilder();
sb.append(prefix).append("TC: " + tc).append("\n");
for (int i = 0; i < tc; ++i) {
prettyPrint(fta, recordDescriptor, i, bbis, dis, sb);
}
System.err.println(sb.toString());
} catch (IOException e) {
e.printStackTrace();
}
}
use of org.apache.hyracks.dataflow.common.comm.util.ByteBufferInputStream in project asterixdb by apache.
the class FrameDebugUtils method prettyPrint.
/**
* Debugging method
* @param tuple
* @param fieldsIdx
* @param descIdx
* @throws HyracksDataException
*/
public void prettyPrint(IFrameTupleAccessor fta, RecordDescriptor recordDescriptor, ITupleReference tuple, int fieldsIdx, int descIdx) throws HyracksDataException {
try (ByteBufferInputStream bbis = new ByteBufferInputStream();
DataInputStream dis = new DataInputStream(bbis)) {
StringBuilder sb = new StringBuilder();
sb.append("[");
sb.append("f" + fieldsIdx + ":(" + tuple.getFieldStart(fieldsIdx) + ", " + (tuple.getFieldLength(fieldsIdx) + tuple.getFieldStart(fieldsIdx)) + ") ");
sb.append("{");
ByteBuffer bytebuff = ByteBuffer.wrap(tuple.getFieldData(fieldsIdx));
bbis.setByteBuffer(bytebuff, tuple.getFieldStart(fieldsIdx));
sb.append(recordDescriptor.getFields()[descIdx].deserialize(dis));
sb.append("}");
sb.append("\n");
System.err.println(sb.toString());
} catch (IOException e) {
e.printStackTrace();
}
}
use of org.apache.hyracks.dataflow.common.comm.util.ByteBufferInputStream in project asterixdb by apache.
the class FrameDebugUtils method prettyPrintTags.
/**
* Debugging method
* @param fta
* @param operator
*/
public void prettyPrintTags(IFrameTupleAccessor fta, String operator) {
try (ByteBufferInputStream bbis = new ByteBufferInputStream();
DataInputStream dis = new DataInputStream(bbis)) {
int tc = fta.getTupleCount();
StringBuilder sb = new StringBuilder();
sb.append(operator + ":");
sb.append("TC: " + tc).append("\n");
for (int i = 0; i < tc; ++i) {
prettyPrintTag(fta, i, bbis, dis, sb);
}
System.err.println(sb.toString());
} catch (IOException e) {
e.printStackTrace();
}
}
use of org.apache.hyracks.dataflow.common.comm.util.ByteBufferInputStream in project asterixdb by apache.
the class FrameDebugUtils method prettyPrint.
/**
* Debugging method
* @param tuple
* @param descF
* @throws HyracksDataException
*/
public void prettyPrint(IFrameTupleAccessor fta, RecordDescriptor recordDescriptor, ITupleReference tuple, int[] descF) throws HyracksDataException {
try (ByteBufferInputStream bbis = new ByteBufferInputStream();
DataInputStream dis = new DataInputStream(bbis)) {
StringBuilder sb = new StringBuilder();
sb.append("[");
for (int j = 0; j < descF.length; ++j) {
sb.append("f" + j + ":(" + tuple.getFieldStart(j) + ", " + (tuple.getFieldLength(j) + tuple.getFieldStart(j)) + ") ");
sb.append("{");
ByteBuffer bytebuff = ByteBuffer.wrap(tuple.getFieldData(j));
bbis.setByteBuffer(bytebuff, tuple.getFieldStart(j));
sb.append(recordDescriptor.getFields()[descF[j]].deserialize(dis));
sb.append("}");
}
sb.append("\n");
System.err.println(sb.toString());
} catch (IOException e) {
e.printStackTrace();
}
}
use of org.apache.hyracks.dataflow.common.comm.util.ByteBufferInputStream in project asterixdb by apache.
the class FrameDebugUtils method prettyPrint.
/**
* Debugging method
* @param fta
* @param recordDescriptor
* @param tid
*/
public void prettyPrint(IFrameTupleAccessor fta, RecordDescriptor recordDescriptor, int tid) {
try (ByteBufferInputStream bbis = new ByteBufferInputStream();
DataInputStream dis = new DataInputStream(bbis)) {
StringBuilder sb = new StringBuilder();
prettyPrint(fta, recordDescriptor, tid, bbis, dis, sb);
System.err.println(sb.toString());
} catch (IOException e) {
e.printStackTrace();
}
}
Aggregations