You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by GitBox <gi...@apache.org> on 2019/05/14 15:53:50 UTC

[GitHub] [skywalking] peng-yongsheng opened a new pull request #2670: New OAP annotations, they are friendly for streaming loader.

peng-yongsheng opened a new pull request #2670: New OAP annotations, they are friendly for streaming loader.
URL: https://github.com/apache/skywalking/pull/2670
 
 
   1. Stream annotation
   This is the most common metrics entity definition with the stream annotations. 
   
   @MetricsType
   @StreamData
   @StorageEntity(name = ServiceRelationClientSideMetrics.INDEX_NAME, builder = ServiceRelationClientSideMetrics.Builder.class, sourceScopeId = DefaultScopeDefine.SERVICE_RELATION)
   
   @MetricsType: What model is streaming processing use? Other types are @RecordType, @InventoryType, @TopNType. 
   @StreamData: Register this entity class into the remote module that makes this entity could transfer between OAP server's nodes. 
   @StorageEntity: Identify the storage entity name, builder class for serialization or deserialization this entity between memory and database.  
   
   Those three annotations look like having clear responsibilities, but if you spend time to reflect on them, you will find that the @XXType's level is higher than others. 
   - @MetricsType and @InventoryType are must include @StreamData and @StorageEntity.
   - @RecordType and @TopNType are must exclude @StreamData.
   
   So, I suggest that let the @StreamData and @StorageEntity to be the parameter of the @XXType.
   
   For example:
   
   @Stream(name = ServiceRelationClientSideMetrics.INDEX_NAME, scopeId = DefaultScopeDefine.SERVICE_RELATION, storage = @Storage(builder = ServiceRelationClientSideMetrics.Builder.class), processor = MetricsStreamProcessor.class)
   public class ServiceRelationClientSideMetrics extends Metrics {
   
   2. Processors
    - MetricsStreamProcessor.class
    - RecordStreamProcessor.class
    - TopNStreamProcessor.class
    - InventoryStreamProcessor.class
   
   Make those processors connect with the stream annotation directly. 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services