Skip to content
Snippets Groups Projects
Commit 0e9641e2 authored by Florian Fittkau's avatar Florian Fittkau
Browse files

minor

parent 6fb0c17b
No related branches found
No related tags found
No related merge requests found
......@@ -67,7 +67,7 @@ public final class TraceReconstructionFilter implements
private void sendOutValidTrace(final Trace trace) {
counter.inputObjects(trace);
putInRingBuffer(trace);
// putInRingBuffer(trace);
}
private void sendOutInvalidTrace(final Trace trace) {
......
......@@ -52,8 +52,6 @@ public class MessageDistributer implements EventHandler<ByteArrayEvent> {
@Override
public void onEvent(final ByteArrayEvent event, final long sequence,
final boolean endOfBatch) throws Exception {
// counter.inputObjectsCount(event.getLength());
final byte[] received = event.getValue();
final int receivedLength = event.getLength();
......@@ -172,9 +170,10 @@ public class MessageDistributer implements EventHandler<ByteArrayEvent> {
putInRingBuffer(new TraceMetadata(traceId, hostname, parentTraceId,
parentOrderId, application));
} else {
final byte[] message = new byte[4 + TraceMetadata.BYTE_LENGTH];
System.arraycopy(b, offset - TraceMetadata.BYTE_LENGTH - 4,
message, 0, TraceMetadata.BYTE_LENGTH + 4);
final byte[] message = new byte[TraceMetadata.BYTE_LENGTH_WITH_CLAZZ_ID];
System.arraycopy(b, offset
- TraceMetadata.BYTE_LENGTH_WITH_CLAZZ_ID, message, 0,
TraceMetadata.BYTE_LENGTH_WITH_CLAZZ_ID);
putInWaitingMessages(message);
}
return offset;
......@@ -196,9 +195,10 @@ public class MessageDistributer implements EventHandler<ByteArrayEvent> {
putInRingBuffer(new BeforeOperationEvent(timestamp, traceId,
orderIndex, operation));
} else {
final byte[] message = new byte[4 + BeforeOperationEvent.BYTE_LENGTH];
System.arraycopy(b, offset - BeforeOperationEvent.BYTE_LENGTH - 4,
message, 0, BeforeOperationEvent.BYTE_LENGTH + 4);
final byte[] message = new byte[BeforeOperationEvent.BYTE_LENGTH_WITH_CLAZZ_ID];
System.arraycopy(b, offset
- BeforeOperationEvent.BYTE_LENGTH_WITH_CLAZZ_ID, message,
0, BeforeOperationEvent.BYTE_LENGTH_WITH_CLAZZ_ID);
putInWaitingMessages(message);
}
return offset;
......@@ -223,9 +223,11 @@ public class MessageDistributer implements EventHandler<ByteArrayEvent> {
putInRingBuffer(new AfterFailedOperationEvent(timestamp, traceId,
orderIndex, operation, cause));
} else {
final byte[] message = new byte[4 + AfterFailedOperationEvent.BYTE_LENGTH];
System.arraycopy(b, offset - AfterFailedOperationEvent.BYTE_LENGTH
- 4, message, 0, AfterFailedOperationEvent.BYTE_LENGTH + 4);
final byte[] message = new byte[AfterFailedOperationEvent.BYTE_LENGTH_WITH_CLAZZ_ID];
System.arraycopy(b, offset
- AfterFailedOperationEvent.BYTE_LENGTH_WITH_CLAZZ_ID,
message, 0,
AfterFailedOperationEvent.BYTE_LENGTH_WITH_CLAZZ_ID);
putInWaitingMessages(message);
}
return offset;
......@@ -246,9 +248,10 @@ public class MessageDistributer implements EventHandler<ByteArrayEvent> {
putInRingBuffer(new AfterOperationEvent(timestamp, traceId,
orderIndex, operation));
} else {
final byte[] message = new byte[4 + AfterOperationEvent.BYTE_LENGTH];
System.arraycopy(b, offset - AfterOperationEvent.BYTE_LENGTH - 4,
message, 0, AfterOperationEvent.BYTE_LENGTH + 4);
final byte[] message = new byte[AfterOperationEvent.BYTE_LENGTH_WITH_CLAZZ_ID];
System.arraycopy(b, offset
- AfterOperationEvent.BYTE_LENGTH_WITH_CLAZZ_ID, message,
0, AfterOperationEvent.BYTE_LENGTH_WITH_CLAZZ_ID);
putInWaitingMessages(message);
}
......@@ -272,10 +275,10 @@ public class MessageDistributer implements EventHandler<ByteArrayEvent> {
private void putInRingBuffer(final IRecord record) {
counter.inputObjects(record);
// final long hiseq = ringBuffer.next();
// final RecordEvent valueEvent = ringBuffer.get(hiseq);
// valueEvent.setValue(record);
// ringBuffer.publish(hiseq);
final long hiseq = ringBuffer.next();
final RecordEvent valueEvent = ringBuffer.get(hiseq);
valueEvent.setValue(record);
ringBuffer.publish(hiseq);
}
public void addToRegistry(final int key, final String value) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment