当前位置: 首页>>代码示例>>Java>>正文


Java PipeWriter.publishWrites方法代码示例

本文整理汇总了Java中com.ociweb.pronghorn.pipe.PipeWriter.publishWrites方法的典型用法代码示例。如果您正苦于以下问题:Java PipeWriter.publishWrites方法的具体用法?Java PipeWriter.publishWrites怎么用?Java PipeWriter.publishWrites使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.ociweb.pronghorn.pipe.PipeWriter的用法示例。


在下文中一共展示了PipeWriter.publishWrites方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: publishOnPrivateTopic

import com.ociweb.pronghorn.pipe.PipeWriter; //导入方法依赖的package包/类
private boolean publishOnPrivateTopic(int token, Writable writable) {
	//this is a private topic            
	Pipe<MessagePrivate> output = publishPrivateTopics.getPipe(token);
	if (PipeWriter.tryWriteFragment(output, MessagePrivate.MSG_PUBLISH_1)) {
				
		DataOutputBlobWriter<MessagePrivate> writer = PipeWriter.outputStream(output);
		DataOutputBlobWriter.openField(writer);
		writable.write(writer);
		DataOutputBlobWriter.closeHighLevelField(writer, MessagePrivate.MSG_PUBLISH_1_FIELD_PAYLOAD_3);
		
		PipeWriter.publishWrites(output);

		return true;
	} else {
		return false;
	}
}
 
开发者ID:oci-pronghorn,项目名称:GreenLightning,代码行数:18,代码来源:MsgCommandChannel.java

示例2: copyToSubscriber

import com.ociweb.pronghorn.pipe.PipeWriter; //导入方法依赖的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;
    }
}
 
开发者ID:oci-pronghorn,项目名称:GreenLightning,代码行数:19,代码来源:MessagePubSubStage.java

示例3: publishConnect

import com.ociweb.pronghorn.pipe.PipeWriter; //导入方法依赖的package包/类
private void publishConnect(Pipe<MQTTClientRequestSchema> output) {

		PipeWriter.presumeWriteFragment(output, MQTTClientRequestSchema.MSG_CONNECT_1);
			
	    PipeWriter.writeInt(output,MQTTClientRequestSchema.MSG_CONNECT_1_FIELD_KEEPALIVESEC_28, keepAliveSeconds);
	    PipeWriter.writeInt(output,MQTTClientRequestSchema.MSG_CONNECT_1_FIELD_FLAGS_29, flags);
	    PipeWriter.writeUTF8(output,MQTTClientRequestSchema.MSG_CONNECT_1_FIELD_CLIENTID_30, (CharSequence) clientId);
	    PipeWriter.writeUTF8(output,MQTTClientRequestSchema.MSG_CONNECT_1_FIELD_WILLTOPIC_31, (CharSequence) lastWillTopic);
	    
	    DataOutputBlobWriter<MQTTClientRequestSchema> writer = PipeWriter.outputStream(output);
	    DataOutputBlobWriter.openField(writer);	
	    if(null!= lastWillPayload) {
	    	lastWillPayload.write((MQTTWriter)writer);
	    }
	    DataOutputBlobWriter.closeHighLevelField(writer, MQTTClientRequestSchema.MSG_CONNECT_1_FIELD_WILLPAYLOAD_32);
	    
	    PipeWriter.writeUTF8(output,MQTTClientRequestSchema.MSG_CONNECT_1_FIELD_USER_33, (CharSequence) user);
	    PipeWriter.writeUTF8(output,MQTTClientRequestSchema.MSG_CONNECT_1_FIELD_PASS_34, (CharSequence) pass);
	    PipeWriter.publishWrites(output);
	}
 
开发者ID:oci-pronghorn,项目名称:GreenLightning,代码行数:21,代码来源:MQTTConfigImpl.java

示例4: writeWithAckImpl

import com.ociweb.pronghorn.pipe.PipeWriter; //导入方法依赖的package包/类
private void writeWithAckImpl(boolean encryption, boolean telemetry) {
	Pipe<PersistedBlobStoreSchema> perStore = PersistedBlobStoreSchema.instance.newPipe(10, 1000);
	
	perStore.initBuffers();
	
	long fieldBlockId = 10;
	byte[] fieldByteArrayBacking = "hello".getBytes();
	int fieldByteArrayPosition = 0;
	int fieldByteArrayLength = fieldByteArrayBacking.length;
	
	PipeWriter.presumeWriteFragment(perStore, PersistedBlobStoreSchema.MSG_BLOCK_1);
	PipeWriter.writeLong(perStore,PersistedBlobStoreSchema.MSG_BLOCK_1_FIELD_BLOCKID_3, fieldBlockId);
	PipeWriter.writeBytes(perStore,PersistedBlobStoreSchema.MSG_BLOCK_1_FIELD_BYTEARRAY_2, fieldByteArrayBacking, fieldByteArrayPosition, fieldByteArrayLength);
	PipeWriter.publishWrites(perStore);
	
	PipeWriter.publishEOF(perStore);
			
	String result = runGraph(perStore, encryption, telemetry);
		
	assertTrue(result, result.indexOf("AckWrite")>0);
	assertTrue(result, result.indexOf("{\"BlockId\":10}")>0);
}
 
开发者ID:oci-pronghorn,项目名称:Pronghorn,代码行数:23,代码来源:SequentialReplayerStageTest.java

示例5: publishBlockChannel

import com.ociweb.pronghorn.pipe.PipeWriter; //导入方法依赖的package包/类
public static void publishBlockChannel(long durationNanos, MsgCommandChannel<?> gcc) {
	
	if (null != gcc.goPipe) {
		PipeWriter.presumeWriteFragment(gcc.goPipe, TrafficOrderSchema.MSG_BLOCKCHANNEL_22);
		PipeWriter.writeLong(gcc.goPipe,TrafficOrderSchema.MSG_BLOCKCHANNEL_22_FIELD_DURATIONNANOS_13, durationNanos);
		PipeWriter.publishWrites(gcc.goPipe);
	} else {
		logger.info("Unable to use block channel for ns without an additonal feature use or USE_DELAY can be added.");
	}
}
 
开发者ID:oci-pronghorn,项目名称:GreenLightning,代码行数:11,代码来源:MsgCommandChannel.java

示例6: publishBlockChannelUntil

import com.ociweb.pronghorn.pipe.PipeWriter; //导入方法依赖的package包/类
public static void publishBlockChannelUntil(long timeMS, MsgCommandChannel<?> gcc) {
	
	if (null != gcc.goPipe) {
		PipeWriter.presumeWriteFragment(gcc.goPipe, TrafficOrderSchema.MSG_BLOCKCHANNELUNTIL_23);
		PipeWriter.writeLong(gcc.goPipe,TrafficOrderSchema.MSG_BLOCKCHANNELUNTIL_23_FIELD_TIMEMS_14, timeMS);
		PipeWriter.publishWrites(gcc.goPipe);
	} else {
		logger.info("Unable to use block channel for ns without an additonal feature or USE_DELAY can be added.");
	}
}
 
开发者ID:oci-pronghorn,项目名称:GreenLightning,代码行数:11,代码来源:MsgCommandChannel.java

示例7: publish

import com.ociweb.pronghorn.pipe.PipeWriter; //导入方法依赖的package包/类
public boolean publish() {
    if (loc!=-1) {
     closeHighLevelField(loc);
     loc = -1;//clear field
     PipeWriter.publishWrites(p);     
     return true;	       
     
    }
    return false;
}
 
开发者ID:oci-pronghorn,项目名称:GreenLightning,代码行数:11,代码来源:PayloadWriter.java

示例8: publishBrokerConfig

import com.ociweb.pronghorn.pipe.PipeWriter; //导入方法依赖的package包/类
private void publishBrokerConfig(Pipe<MQTTClientRequestSchema> output) {
	PipeWriter.presumeWriteFragment(output, MQTTClientRequestSchema.MSG_BROKERCONFIG_100);
		
    PipeWriter.writeUTF8(output,MQTTClientRequestSchema.MSG_BROKERCONFIG_100_FIELD_HOST_26, (CharSequence) host);
    PipeWriter.writeInt(output,MQTTClientRequestSchema.MSG_BROKERCONFIG_100_FIELD_PORT_27, port);
    PipeWriter.publishWrites(output);
			
}
 
开发者ID:oci-pronghorn,项目名称:GreenLightning,代码行数:9,代码来源:MQTTConfigImpl.java

示例9: publish

import com.ociweb.pronghorn.pipe.PipeWriter; //导入方法依赖的package包/类
private void publish(Pipe<ValveSchema> output) {
	PipeWriter.presumeWriteFragment(output, msgIdx);
	PipeWriter.writeInt(output, stationFieldId, currentStationId);
	PipeWriter.writeLong(output, timestampFieldId, currentTimeStamp);
	//System.out.format("Wrote %d, %d, %d\n", msgIdx, currentStationId, currentTimeStamp);
	writeValue(output);
	PipeWriter.publishWrites(output);
}
 
开发者ID:oci-pronghorn,项目名称:FogLight-Examples,代码行数:9,代码来源:FilterStage.java

示例10: publishValveSerialNumber

import com.ociweb.pronghorn.pipe.PipeWriter; //导入方法依赖的package包/类
public static void publishValveSerialNumber(Pipe<ValveSchema> output, int fieldStation, long fieldTimestamp, int fieldValveSerialNumber) {
    PipeWriter.presumeWriteFragment(output, MSG_VALVESERIALNUMBER_311);
    PipeWriter.writeInt(output,MSG_VALVESERIALNUMBER_311_FIELD_STATION_1, fieldStation);
    PipeWriter.writeLong(output,MSG_VALVESERIALNUMBER_311_FIELD_TIMESTAMP_2, fieldTimestamp);
    PipeWriter.writeInt(output,MSG_VALVESERIALNUMBER_311_FIELD_VALVESERIALNUMBER_11, fieldValveSerialNumber);
    PipeWriter.publishWrites(output);
}
 
开发者ID:oci-pronghorn,项目名称:FogLight-Examples,代码行数:8,代码来源:ValveSchema.java

示例11: publishLifeCycleCount

import com.ociweb.pronghorn.pipe.PipeWriter; //导入方法依赖的package包/类
public static void publishLifeCycleCount(Pipe<ValveSchema> output, int fieldStation, long fieldTimestamp, int fieldLifeCycleCount) {
    PipeWriter.presumeWriteFragment(output, MSG_LIFECYCLECOUNT_312);
    PipeWriter.writeInt(output,MSG_LIFECYCLECOUNT_312_FIELD_STATION_1, fieldStation);
    PipeWriter.writeLong(output,MSG_LIFECYCLECOUNT_312_FIELD_TIMESTAMP_2, fieldTimestamp);
    PipeWriter.writeInt(output,MSG_LIFECYCLECOUNT_312_FIELD_LIFECYCLECOUNT_12, fieldLifeCycleCount);
    PipeWriter.publishWrites(output);
}
 
开发者ID:oci-pronghorn,项目名称:FogLight-Examples,代码行数:8,代码来源:ValveSchema.java

示例12: publishSupplyPressure

import com.ociweb.pronghorn.pipe.PipeWriter; //导入方法依赖的package包/类
public static void publishSupplyPressure(Pipe<ValveSchema> output, int fieldStation, long fieldTimestamp, int fieldSupplyPressure) {
    PipeWriter.presumeWriteFragment(output, MSG_SUPPLYPRESSURE_313);
    PipeWriter.writeInt(output,MSG_SUPPLYPRESSURE_313_FIELD_STATION_1, fieldStation);
    PipeWriter.writeLong(output,MSG_SUPPLYPRESSURE_313_FIELD_TIMESTAMP_2, fieldTimestamp);
    PipeWriter.writeInt(output,MSG_SUPPLYPRESSURE_313_FIELD_SUPPLYPRESSURE_13, fieldSupplyPressure);
    PipeWriter.publishWrites(output);
}
 
开发者ID:oci-pronghorn,项目名称:FogLight-Examples,代码行数:8,代码来源:ValveSchema.java

示例13: publishDurationOfLast1_4Signal

import com.ociweb.pronghorn.pipe.PipeWriter; //导入方法依赖的package包/类
public static void publishDurationOfLast1_4Signal(Pipe<ValveSchema> output, int fieldStation, long fieldTimestamp, int fieldDurationOfLast1_4Signal) {
    PipeWriter.presumeWriteFragment(output, MSG_DURATIONOFLAST1_4SIGNAL_314);
    PipeWriter.writeInt(output,MSG_DURATIONOFLAST1_4SIGNAL_314_FIELD_STATION_1, fieldStation);
    PipeWriter.writeLong(output,MSG_DURATIONOFLAST1_4SIGNAL_314_FIELD_TIMESTAMP_2, fieldTimestamp);
    PipeWriter.writeInt(output,MSG_DURATIONOFLAST1_4SIGNAL_314_FIELD_DURATIONOFLAST1_4SIGNAL_14, fieldDurationOfLast1_4Signal);
    PipeWriter.publishWrites(output);
}
 
开发者ID:oci-pronghorn,项目名称:FogLight-Examples,代码行数:8,代码来源:ValveSchema.java

示例14: publishDurationOfLast1_2Signal

import com.ociweb.pronghorn.pipe.PipeWriter; //导入方法依赖的package包/类
public static void publishDurationOfLast1_2Signal(Pipe<ValveSchema> output, int fieldStation, long fieldTimestamp, int fieldDurationOfLast1_2Signal) {
    PipeWriter.presumeWriteFragment(output, MSG_DURATIONOFLAST1_2SIGNAL_315);
    PipeWriter.writeInt(output,MSG_DURATIONOFLAST1_2SIGNAL_315_FIELD_STATION_1, fieldStation);
    PipeWriter.writeLong(output,MSG_DURATIONOFLAST1_2SIGNAL_315_FIELD_TIMESTAMP_2, fieldTimestamp);
    PipeWriter.writeInt(output,MSG_DURATIONOFLAST1_2SIGNAL_315_FIELD_DURATIONOFLAST1_2SIGNAL_15, fieldDurationOfLast1_2Signal);
    PipeWriter.publishWrites(output);
}
 
开发者ID:oci-pronghorn,项目名称:FogLight-Examples,代码行数:8,代码来源:ValveSchema.java

示例15: publishEqualizationAveragePressure

import com.ociweb.pronghorn.pipe.PipeWriter; //导入方法依赖的package包/类
public static void publishEqualizationAveragePressure(Pipe<ValveSchema> output, int fieldStation, long fieldTimestamp, int fieldEqualizationAveragePressure) {
    PipeWriter.presumeWriteFragment(output, MSG_EQUALIZATIONAVERAGEPRESSURE_316);
    PipeWriter.writeInt(output,MSG_EQUALIZATIONAVERAGEPRESSURE_316_FIELD_STATION_1, fieldStation);
    PipeWriter.writeLong(output,MSG_EQUALIZATIONAVERAGEPRESSURE_316_FIELD_TIMESTAMP_2, fieldTimestamp);
    PipeWriter.writeInt(output,MSG_EQUALIZATIONAVERAGEPRESSURE_316_FIELD_EQUALIZATIONAVERAGEPRESSURE_16, fieldEqualizationAveragePressure);
    PipeWriter.publishWrites(output);
}
 
开发者ID:oci-pronghorn,项目名称:FogLight-Examples,代码行数:8,代码来源:ValveSchema.java


注:本文中的com.ociweb.pronghorn.pipe.PipeWriter.publishWrites方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。