@Override public void eventFired(byte[] event) { try { BaseMessage bm = m.demarshall(event); if (bm.getType().equals(CommandType.CUST_CMD)) { String custCommand = ((AQMessages.CustomCommand) bm .getExtension(AQMessages.CustomCommand.cmd)) .getCommand(); if (custCommand.startsWith("LATENCY_RES")) { String[] parts = custCommand.split(" "); long l1 = Long.parseLong(parts[1]); long l2 = Long.parseLong(parts[2]); long l3 = System.nanoTime(); // utsg.now().getNanoseconds(); long fromHereToThere = l2 - l1; long fromTheretoHere = l3 - l2; long roundTrip = l3 - l1; L1 += fromHereToThere; L2 += fromTheretoHere; L3 += roundTrip; counter--; // } } } catch (InvalidProtocolBufferException e) { e.printStackTrace(); } } });
public int getSerializedSize() { int size = memoizedSerializedSize; if (size != -1) return size; size = 0; if (((bitField0_ & 0x00000001) == 0x00000001)) { size += com.google.protobuf.CodedOutputStream .computeBytesSize(1, getCommandBytes()); } size += getUnknownFields().getSerializedSize(); memoizedSerializedSize = size; return size; }
public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { getSerializedSize(); if (((bitField0_ & 0x00000001) == 0x00000001)) { output.writeBytes(1, getCommandBytes()); } getUnknownFields().writeTo(output); }
public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder(com.activequant.messages.AQMessages.CustomCommand prototype) {
public String demarshall(AQMessages.CustomCommand adm) { return adm.getCommand(); }
public Builder toBuilder() { return newBuilder(this); }
public static Builder newBuilder(com.activequant.messages.AQMessages.CustomCommand prototype) { return newBuilder().mergeFrom(prototype); } public Builder toBuilder() { return newBuilder(this); }
public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return com.activequant.messages.AQMessages.CustomCommand.getDescriptor(); }
public com.activequant.messages.AQMessages.CustomCommand getDefaultInstanceForType() { return com.activequant.messages.AQMessages.CustomCommand.getDefaultInstance(); }
/** * * @param msg * @return */ public BaseMessage buildCustomCommand(String msg) { AQMessages.CustomCommand l = AQMessages.CustomCommand.newBuilder() .setCommand(msg).build(); return wrap(BaseMessage.CommandType.CUST_CMD, AQMessages.CustomCommand.cmd, l); }
public static com.activequant.messages.AQMessages.CustomCommand parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { Builder builder = newBuilder(); if (builder.mergeDelimitedFrom(input, extensionRegistry)) { return builder.buildParsed(); } else { return null; } } public static com.activequant.messages.AQMessages.CustomCommand parseFrom(
public com.activequant.messages.AQMessages.CustomCommand build() { com.activequant.messages.AQMessages.CustomCommand result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; }
public com.activequant.messages.AQMessages.CustomCommand buildPartial() { com.activequant.messages.AQMessages.CustomCommand result = new com.activequant.messages.AQMessages.CustomCommand(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0; if (((from_bitField0_ & 0x00000001) == 0x00000001)) { to_bitField0_ |= 0x00000001; } result.command_ = command_; result.bitField0_ = to_bitField0_; onBuilt(); return result; }
public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized != -1) return isInitialized == 1; if (!hasCommand()) { memoizedIsInitialized = 0; return false; } memoizedIsInitialized = 1; return true; }
public Builder clearCommand() { bitField0_ = (bitField0_ & ~0x00000001); command_ = getDefaultInstance().getCommand(); onChanged(); return this; } void setCommand(com.google.protobuf.ByteString value) {
public static com.activequant.messages.AQMessages.CustomCommand parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return newBuilder().mergeFrom(input, extensionRegistry) .buildParsed(); }
public static com.activequant.messages.AQMessages.CustomCommand parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { Builder builder = newBuilder(); if (builder.mergeDelimitedFrom(input)) { return builder.buildParsed(); } else { return null; } } public static com.activequant.messages.AQMessages.CustomCommand parseDelimitedFrom(
public static com.activequant.messages.AQMessages.CustomCommand parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return newBuilder().mergeFrom(input, extensionRegistry) .buildParsed(); } public static com.activequant.messages.AQMessages.CustomCommand parseDelimitedFrom(java.io.InputStream input)
public Builder mergeFrom(com.activequant.messages.AQMessages.CustomCommand other) { if (other == com.activequant.messages.AQMessages.CustomCommand.getDefaultInstance()) return this; if (other.hasCommand()) { setCommand(other.getCommand()); } this.mergeUnknownFields(other.getUnknownFields()); return this; }
public static com.activequant.messages.AQMessages.CustomCommand parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return newBuilder().mergeFrom(data, extensionRegistry) .buildParsed(); } public static com.activequant.messages.AQMessages.CustomCommand parseFrom(java.io.InputStream input)