本文整理汇总了Java中com.ociweb.pronghorn.pipe.PipeReader类的典型用法代码示例。如果您正苦于以下问题:Java PipeReader类的具体用法?Java PipeReader怎么用?Java PipeReader使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PipeReader类属于com.ociweb.pronghorn.pipe包,在下文中一共展示了PipeReader类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: consume
import com.ociweb.pronghorn.pipe.PipeReader; //导入依赖的package包/类
public static void consume(Pipe<MessagePubSub> input) {
while (PipeReader.tryReadFragment(input)) {
int msgIdx = PipeReader.getMsgIdx(input);
switch(msgIdx) {
case MSG_SUBSCRIBE_100:
consumeSubscribe(input);
break;
case MSG_UNSUBSCRIBE_101:
consumeUnsubscribe(input);
break;
case MSG_PUBLISH_103:
consumePublish(input);
break;
case MSG_CHANGESTATE_70:
consumeChangeState(input);
break;
case -1:
//requestShutdown();
break;
}
PipeReader.releaseReadLock(input);
}
}
示例2: consume
import com.ociweb.pronghorn.pipe.PipeReader; //导入依赖的package包/类
public static void consume(Pipe<TrafficOrderSchema> input) {
while (PipeReader.tryReadFragment(input)) {
int msgIdx = PipeReader.getMsgIdx(input);
switch(msgIdx) {
case MSG_GO_10:
consumeGo(input);
break;
case MSG_BLOCKCHANNEL_22:
consumeBlockChannel(input);
break;
case MSG_BLOCKCHANNELUNTIL_23:
consumeBlockChannelUntil(input);
break;
case -1:
//requestShutdown();
break;
}
PipeReader.releaseReadLock(input);
}
}
示例3: consume
import com.ociweb.pronghorn.pipe.PipeReader; //导入依赖的package包/类
public static void consume(Pipe<MessageSubscription> input) {
while (PipeReader.tryReadFragment(input)) {
int msgIdx = PipeReader.getMsgIdx(input);
switch(msgIdx) {
case MSG_PUBLISH_103:
consumePublish(input);
break;
case MSG_STATECHANGED_71:
consumeStateChanged(input);
break;
case -1:
//requestShutdown();
break;
}
PipeReader.releaseReadLock(input);
}
}
示例4: copyToSubscriber
import com.ociweb.pronghorn.pipe.PipeReader; //导入依赖的package包/类
private void copyToSubscriber(Pipe<?> pipe, int pipeIdx, long[] targetMarks, int topicLOC, int payloadLOC) {
Pipe<MessageSubscription> outPipe = outgoingMessagePipes[pipeIdx];
if (PipeWriter.tryWriteFragment(outPipe, MessageSubscription.MSG_PUBLISH_103)) {
PipeReader.copyBytes(pipe, outPipe, topicLOC, MessageSubscription.MSG_PUBLISH_103_FIELD_TOPIC_1);
PipeReader.copyBytes(pipe, outPipe, payloadLOC, MessageSubscription.MSG_PUBLISH_103_FIELD_PAYLOAD_3);
//due to batching this may not become the head position upon publish but it will do so eventually.
//so to track this position we use workingHeadPosition not headPosition
targetMarks[pipeIdx] = Pipe.workingHeadPosition(outPipe);
PipeWriter.publishWrites(outPipe);
} else {
//add this one back to the list so we can send again later
pendingPublish[pendingPublishCount++] = pipeIdx;
pendingIngress = false;
}
}
示例5: toString
import com.ociweb.pronghorn.pipe.PipeReader; //导入依赖的package包/类
public String toString() {
StringBuilder builder = new StringBuilder();
builder.append("topic: ");
PipeReader.readUTF8(pipe, topic, builder);
builder.append(" payload: ");
DataInputBlobReader<?> stream = PipeReader.inputStream(pipe, payload);
while (stream.hasRemainingBytes()) {
Appendables.appendFixedHexDigits(builder, (0xFF&stream.readByte()), 8);
if (stream.hasRemainingBytes()) {
builder.append(',');
}
}
return builder.toString();
}
示例6: run
import com.ociweb.pronghorn.pipe.PipeReader; //导入依赖的package包/类
@Override
public void run() {
while (PipeWriter.hasRoomForWrite(output) && PipeReader.tryReadFragment(input)) {
int msgIdx = PipeReader.getMsgIdx(input);
//System.out.format("\nMessage Idx %d %d %d\n", msgIdx, Pipe.tailPosition(input), input.sizeOfSlabRing);
if (msgIdx >= 0) {
MessageProcessor msg = messages[msgIdx];
if (msg != null) {
msg.readAndWrite(input, output);
}
//else {
//System.out.format("Not Found %d", msgIdx);
//}
PipeReader.releaseReadLock(input);
}
else {
PipeReader.releaseReadLock(input);
PipeWriter.publishEOF(output);
requestShutdown();
//System.out.format("End of the line");
return;
}
}
}
示例7: consume
import com.ociweb.pronghorn.pipe.PipeReader; //导入依赖的package包/类
public static void consume(Pipe<PersistedBlobLoadSchema> input) {
while (PipeReader.tryReadFragment(input)) {
int msgIdx = PipeReader.getMsgIdx(input);
switch(msgIdx) {
case MSG_BLOCK_1:
consumeBlock(input);
break;
case MSG_BEGINREPLAY_8:
consumeBeginReplay(input);
break;
case MSG_FINISHREPLAY_9:
consumeFinishReplay(input);
break;
case MSG_ACKRELEASE_10:
consumeAckRelease(input);
break;
case MSG_ACKWRITE_11:
consumeAckWrite(input);
break;
case -1:
//requestShutdown();
break;
}
PipeReader.releaseReadLock(input);
}
}
示例8: consume014
import com.ociweb.pronghorn.pipe.PipeReader; //导入依赖的package包/类
public static void consume014(Pipe<PhastCodecSchema> input) {
long fieldvalue001 = PipeReader.readLong(input,MSG_014_10014_FIELD_VALUE001_1);
long fieldvalue002 = PipeReader.readLong(input,MSG_014_10014_FIELD_VALUE002_2);
long fieldvalue003 = PipeReader.readLong(input,MSG_014_10014_FIELD_VALUE003_3);
long fieldvalue004 = PipeReader.readLong(input,MSG_014_10014_FIELD_VALUE004_4);
long fieldvalue005 = PipeReader.readLong(input,MSG_014_10014_FIELD_VALUE005_5);
long fieldvalue006 = PipeReader.readLong(input,MSG_014_10014_FIELD_VALUE006_6);
long fieldvalue007 = PipeReader.readLong(input,MSG_014_10014_FIELD_VALUE007_7);
long fieldvalue008 = PipeReader.readLong(input,MSG_014_10014_FIELD_VALUE008_8);
long fieldvalue009 = PipeReader.readLong(input,MSG_014_10014_FIELD_VALUE009_9);
long fieldvalue010 = PipeReader.readLong(input,MSG_014_10014_FIELD_VALUE010_10);
long fieldvalue011 = PipeReader.readLong(input,MSG_014_10014_FIELD_VALUE011_11);
long fieldvalue012 = PipeReader.readLong(input,MSG_014_10014_FIELD_VALUE012_12);
long fieldvalue013 = PipeReader.readLong(input,MSG_014_10014_FIELD_VALUE013_13);
long fieldvalue014 = PipeReader.readLong(input,MSG_014_10014_FIELD_VALUE014_14);
}
示例9: consume
import com.ociweb.pronghorn.pipe.PipeReader; //导入依赖的package包/类
public static void consume(Pipe<ServerResponseSchema> input) {
while (PipeReader.tryReadFragment(input)) {
int msgIdx = PipeReader.getMsgIdx(input);
switch(msgIdx) {
case MSG_TOCHANNEL_100:
consumeToChannel(input);
break;
case MSG_TOSUBSCRIPTION_200:
consumeToSubscription(input);
break;
case MSG_SKIP_300:
consumeSkip(input);
break;
case -1:
//requestShutdown();
break;
}
PipeReader.releaseReadLock(input);
}
}
示例10: consume
import com.ociweb.pronghorn.pipe.PipeReader; //导入依赖的package包/类
public static void consume(Pipe<SequentialRespSchema> input) {
while (PipeReader.tryReadFragment(input)) {
int msgIdx = PipeReader.getMsgIdx(input);
switch(msgIdx) {
case MSG_CLEARACK_1:
consumeClearAck(input);
break;
case MSG_METARESPONSE_2:
consumeMetaResponse(input);
break;
case MSG_WRITEACK_3:
consumeWriteAck(input);
break;
case -1:
//requestShutdown();
break;
}
PipeReader.releaseReadLock(input);
}
}
示例11: run
import com.ociweb.pronghorn.pipe.PipeReader; //导入依赖的package包/类
@Override
public void run() {
int activePipe = pipeIdx;
if (activePipe>=0) {
//never start new work until old work is finished
if (pumpData(activePipe)) {
PipeReader.releaseReadLock(fromCommandChannels[activePipe]);
//only do now after we know its not blocked and was completed
decReleaseCount(activePipe);
pipeIdx = -1;
} else {
return;//try again later.
}
}
super.run();
}
示例12: consume
import com.ociweb.pronghorn.pipe.PipeReader; //导入依赖的package包/类
public static void consume(Pipe<HTTPRequestSchema> input) {
while (PipeReader.tryReadFragment(input)) {
int msgIdx = PipeReader.getMsgIdx(input);
switch(msgIdx) {
case MSG_RESTREQUEST_300:
consumeRestRequest(input);
break;
case MSG_WEBSOCKETFRAME_100:
consumeWebSocketFrame(input);
break;
case -1:
//requestShutdown();
break;
}
PipeReader.releaseReadLock(input);
}
}
示例13: consume024
import com.ociweb.pronghorn.pipe.PipeReader; //导入依赖的package包/类
public static void consume024(Pipe<PhastCodecSchema> input) {
long fieldvalue001 = PipeReader.readLong(input,MSG_024_10024_FIELD_VALUE001_1);
long fieldvalue002 = PipeReader.readLong(input,MSG_024_10024_FIELD_VALUE002_2);
long fieldvalue003 = PipeReader.readLong(input,MSG_024_10024_FIELD_VALUE003_3);
long fieldvalue004 = PipeReader.readLong(input,MSG_024_10024_FIELD_VALUE004_4);
long fieldvalue005 = PipeReader.readLong(input,MSG_024_10024_FIELD_VALUE005_5);
long fieldvalue006 = PipeReader.readLong(input,MSG_024_10024_FIELD_VALUE006_6);
long fieldvalue007 = PipeReader.readLong(input,MSG_024_10024_FIELD_VALUE007_7);
long fieldvalue008 = PipeReader.readLong(input,MSG_024_10024_FIELD_VALUE008_8);
long fieldvalue009 = PipeReader.readLong(input,MSG_024_10024_FIELD_VALUE009_9);
long fieldvalue010 = PipeReader.readLong(input,MSG_024_10024_FIELD_VALUE010_10);
long fieldvalue011 = PipeReader.readLong(input,MSG_024_10024_FIELD_VALUE011_11);
long fieldvalue012 = PipeReader.readLong(input,MSG_024_10024_FIELD_VALUE012_12);
long fieldvalue013 = PipeReader.readLong(input,MSG_024_10024_FIELD_VALUE013_13);
long fieldvalue014 = PipeReader.readLong(input,MSG_024_10024_FIELD_VALUE014_14);
long fieldvalue015 = PipeReader.readLong(input,MSG_024_10024_FIELD_VALUE015_15);
long fieldvalue016 = PipeReader.readLong(input,MSG_024_10024_FIELD_VALUE016_16);
long fieldvalue017 = PipeReader.readLong(input,MSG_024_10024_FIELD_VALUE017_17);
long fieldvalue018 = PipeReader.readLong(input,MSG_024_10024_FIELD_VALUE018_18);
long fieldvalue019 = PipeReader.readLong(input,MSG_024_10024_FIELD_VALUE019_19);
long fieldvalue020 = PipeReader.readLong(input,MSG_024_10024_FIELD_VALUE020_20);
long fieldvalue021 = PipeReader.readLong(input,MSG_024_10024_FIELD_VALUE021_21);
long fieldvalue022 = PipeReader.readLong(input,MSG_024_10024_FIELD_VALUE022_22);
long fieldvalue023 = PipeReader.readLong(input,MSG_024_10024_FIELD_VALUE023_23);
long fieldvalue024 = PipeReader.readLong(input,MSG_024_10024_FIELD_VALUE024_24);
}
示例14: run
import com.ociweb.pronghorn.pipe.PipeReader; //导入依赖的package包/类
@Override
public void run() {
if (moveInProgress) {
if (!PipeReader.tryMoveSingleMessage(input, output)) {
return;
} else {
moveInProgress = false;
PipeReader.releaseReadLock(input);
}
}
while (PipeWriter.hasRoomForWrite(output) && PipeReader.tryReadFragment(input)) {
count++;
int value = PipeReader.readInt(input, varFieldLoc);
if (0 != (mask&value)) {
if (!PipeReader.tryMoveSingleMessage(input, output)) {
moveInProgress = true;
return;
}
}
PipeReader.releaseReadLock(input);
}
}
示例15: consume
import com.ociweb.pronghorn.pipe.PipeReader; //导入依赖的package包/类
public static void consume(Pipe<TwitterEventSchema> input) {
while (PipeReader.tryReadFragment(input)) {
int msgIdx = PipeReader.getMsgIdx(input);
switch(msgIdx) {
case MSG_USER_100:
consumeUser(input);
break;
case MSG_USERPOST_101:
consumeUserPost(input);
break;
case -1:
//requestShutdown();
break;
}
PipeReader.releaseReadLock(input);
}
}