This is an automated email from the ASF dual-hosted git repository.

wusheng pushed a commit to branch 6.0
in repository https://gitbox.apache.org/repos/asf/incubator-skywalking.git


The following commit(s) were added to refs/heads/6.0 by this push:
     new 8a89221  Push generated codes with percent and percent boolean 
expression. CC @peng-yongsheng
8a89221 is described below

commit 8a892219e44fc7feb8584478b67928acc0097c25
Author: Wu Sheng <[email protected]>
AuthorDate: Tue Aug 14 23:48:54 2018 +0800

    Push generated codes with percent and percent boolean expression. CC 
@peng-yongsheng
---
 .../generated/endpoint/EndpointAvgIndicator.java   | 131 +++++++++++++++++++++
 .../generated/endpoint/EndpointDispatcher.java     |  58 +++++++++
 .../endpoint/EndpointPercentIndicator.java         | 131 +++++++++++++++++++++
 .../generated/service/ServiceDispatcher.java       |  33 ++++++
 .../core/analysis/indicator/PercentIndicator.java  |  59 ++++++++++
 .../analysis/indicator/annotation/Expression.java  |  32 +++++
 .../indicator/annotation/ExpressionArg0.java       |  32 +++++
 .../indicator/annotation/ExpressionArg1.java       |  32 +++++
 .../expression/BinaryMatchExpression.java          |  40 +++++++
 .../indicator/expression/BooleanBinaryMatch.java   |  29 +++++
 .../skywalking/oap/server/core/source/Service.java |  31 +++++
 11 files changed, 608 insertions(+)

diff --git 
a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/endpoint/EndpointAvgIndicator.java
 
b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/endpoint/EndpointAvgIndicator.java
new file mode 100644
index 0000000..934d0dc
--- /dev/null
+++ 
b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/endpoint/EndpointAvgIndicator.java
@@ -0,0 +1,131 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.oap.server.core.analysis.generated.endpoint;
+
+import java.util.*;
+import lombok.*;
+import org.apache.skywalking.oap.server.core.analysis.indicator.*;
+import 
org.apache.skywalking.oap.server.core.analysis.indicator.annotation.IndicatorType;
+import org.apache.skywalking.oap.server.core.remote.annotation.StreamData;
+import org.apache.skywalking.oap.server.core.remote.grpc.proto.RemoteData;
+import org.apache.skywalking.oap.server.core.storage.annotation.*;
+import org.apache.skywalking.oap.server.core.storage.StorageBuilder;
+
+/**
+ * This class is auto generated. Please don't change this class manually.
+ *
+ * @author Observability Analysis Language code generator
+ */
+@IndicatorType
+@StreamData
+@StorageEntity(name = "endpoint_avg", builder = 
EndpointAvgIndicator.Builder.class)
+public class EndpointAvgIndicator extends AvgIndicator {
+
+    @Setter @Getter @Column(columnName = "id") private int id;
+    @Setter @Getter @Column(columnName = "service_id") private int serviceId;
+    @Setter @Getter @Column(columnName = "service_instance_id") private int 
serviceInstanceId;
+
+    @Override public String id() {
+        return String.valueOf(id);
+    }
+
+    @Override public int hashCode() {
+        int result = 17;
+        result = 31 * result + id;
+        result = 31 * result + (int)getTimeBucket();
+        return result;
+    }
+
+
+    @Override public boolean equals(Object obj) {
+        if (this == obj)
+            return true;
+        if (obj == null)
+            return false;
+        if (getClass() != obj.getClass())
+            return false;
+
+        EndpointAvgIndicator indicator = (EndpointAvgIndicator)obj;
+        if (id != indicator.id)
+            return false;
+        if (getTimeBucket() != indicator.getTimeBucket())
+            return false;
+
+        return true;
+    }
+
+
+    @Override public RemoteData.Builder serialize() {
+        RemoteData.Builder remoteBuilder = RemoteData.newBuilder();
+
+        remoteBuilder.setDataLongs(0, getTimeBucket());
+        remoteBuilder.setDataLongs(1, getSummation());
+        remoteBuilder.setDataLongs(2, getValue());
+        remoteBuilder.setDataLongs(3, getTimeBucket());
+
+
+        remoteBuilder.setDataIntegers(0, getId());
+        remoteBuilder.setDataIntegers(1, getServiceId());
+        remoteBuilder.setDataIntegers(2, getServiceInstanceId());
+        remoteBuilder.setDataIntegers(3, getCount());
+
+        return remoteBuilder;
+    }
+
+    @Override public void deserialize(RemoteData remoteData) {
+
+        setTimeBucket(remoteData.getDataLongs(0));
+        setSummation(remoteData.getDataLongs(1));
+        setValue(remoteData.getDataLongs(2));
+        setTimeBucket(remoteData.getDataLongs(3));
+
+
+        setId(remoteData.getDataIntegers(0));
+        setServiceId(remoteData.getDataIntegers(1));
+        setServiceInstanceId(remoteData.getDataIntegers(2));
+        setCount(remoteData.getDataIntegers(3));
+    }
+
+    public static class Builder implements 
StorageBuilder<EndpointAvgIndicator> {
+
+        @Override public Map<String, Object> data2Map(EndpointAvgIndicator 
storageData) {
+            Map<String, Object> map = new HashMap<>();
+            map.put("id", storageData.getId());
+            map.put("service_id", storageData.getServiceId());
+            map.put("service_instance_id", storageData.getServiceInstanceId());
+            map.put("summation", storageData.getSummation());
+            map.put("count", storageData.getCount());
+            map.put("value", storageData.getValue());
+            map.put("time_bucket", storageData.getTimeBucket());
+            return map;
+        }
+
+        @Override public EndpointAvgIndicator map2Data(Map<String, Object> 
dbMap) {
+            EndpointAvgIndicator indicator = new EndpointAvgIndicator();
+            indicator.setId((int)dbMap.get("id"));
+            indicator.setServiceId((int)dbMap.get("service_id"));
+            
indicator.setServiceInstanceId((int)dbMap.get("service_instance_id"));
+            indicator.setSummation((long)dbMap.get("summation"));
+            indicator.setCount((int)dbMap.get("count"));
+            indicator.setValue((long)dbMap.get("value"));
+            indicator.setTimeBucket((long)dbMap.get("time_bucket"));
+            return indicator;
+        }
+    }
+}
diff --git 
a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/endpoint/EndpointDispatcher.java
 
b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/endpoint/EndpointDispatcher.java
new file mode 100644
index 0000000..4f54a6b
--- /dev/null
+++ 
b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/endpoint/EndpointDispatcher.java
@@ -0,0 +1,58 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.oap.server.core.analysis.generated.endpoint;
+
+import org.apache.skywalking.oap.server.core.analysis.SourceDispatcher;
+import org.apache.skywalking.oap.server.core.analysis.worker.IndicatorProcess;
+import org.apache.skywalking.oap.server.core.source.Endpoint;
+
+/**
+ * This class is auto generated. Please don't change this class manually.
+ *
+ * @author Observability Analysis Language code generator
+ */
+public class EndpointDispatcher implements SourceDispatcher<Endpoint> {
+
+
+    @Override public void dispatch(Endpoint source) {
+        doEndpointAvg(source);
+        doEndpointPercent(source);
+    }
+
+    private void doEndpointAvg(Endpoint source) {
+        EndpointAvgIndicator indicator = new EndpointAvgIndicator();
+
+        indicator.setTimeBucket(source.getTimeBucket());
+        indicator.setId(source.getId());
+        indicator.setServiceId(source.getServiceId());
+        indicator.setServiceInstanceId(source.getServiceInstanceId());
+        indicator.combine(source.getLatency(), 1);
+        IndicatorProcess.INSTANCE.in(indicator);
+    }
+    private void doEndpointPercent(Endpoint source) {
+        EndpointPercentIndicator indicator = new EndpointPercentIndicator();
+
+        indicator.setTimeBucket(source.getTimeBucket());
+        indicator.setId(source.getId());
+        indicator.setServiceId(source.getServiceId());
+        indicator.setServiceInstanceId(source.getServiceInstanceId());
+        indicator.combine(new 
org.apache.skywalking.oap.server.core.analysis.indicator.expression.BooleanBinaryMatch(),
 source.isStatus(), true);
+        IndicatorProcess.INSTANCE.in(indicator);
+    }
+}
diff --git 
a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/endpoint/EndpointPercentIndicator.java
 
b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/endpoint/EndpointPercentIndicator.java
new file mode 100644
index 0000000..7df931a
--- /dev/null
+++ 
b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/endpoint/EndpointPercentIndicator.java
@@ -0,0 +1,131 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.oap.server.core.analysis.generated.endpoint;
+
+import java.util.*;
+import lombok.*;
+import org.apache.skywalking.oap.server.core.analysis.indicator.*;
+import 
org.apache.skywalking.oap.server.core.analysis.indicator.annotation.IndicatorType;
+import org.apache.skywalking.oap.server.core.remote.annotation.StreamData;
+import org.apache.skywalking.oap.server.core.remote.grpc.proto.RemoteData;
+import org.apache.skywalking.oap.server.core.storage.annotation.*;
+import org.apache.skywalking.oap.server.core.storage.StorageBuilder;
+
+/**
+ * This class is auto generated. Please don't change this class manually.
+ *
+ * @author Observability Analysis Language code generator
+ */
+@IndicatorType
+@StreamData
+@StorageEntity(name = "endpoint_percent", builder = 
EndpointPercentIndicator.Builder.class)
+public class EndpointPercentIndicator extends PercentIndicator {
+
+    @Setter @Getter @Column(columnName = "id") private int id;
+    @Setter @Getter @Column(columnName = "service_id") private int serviceId;
+    @Setter @Getter @Column(columnName = "service_instance_id") private int 
serviceInstanceId;
+
+    @Override public String id() {
+        return String.valueOf(id);
+    }
+
+    @Override public int hashCode() {
+        int result = 17;
+        result = 31 * result + id;
+        result = 31 * result + (int)getTimeBucket();
+        return result;
+    }
+
+
+    @Override public boolean equals(Object obj) {
+        if (this == obj)
+            return true;
+        if (obj == null)
+            return false;
+        if (getClass() != obj.getClass())
+            return false;
+
+        EndpointPercentIndicator indicator = (EndpointPercentIndicator)obj;
+        if (id != indicator.id)
+            return false;
+        if (getTimeBucket() != indicator.getTimeBucket())
+            return false;
+
+        return true;
+    }
+
+
+    @Override public RemoteData.Builder serialize() {
+        RemoteData.Builder remoteBuilder = RemoteData.newBuilder();
+
+        remoteBuilder.setDataLongs(0, getTimeBucket());
+        remoteBuilder.setDataLongs(1, getTotal());
+        remoteBuilder.setDataLongs(2, getMatch());
+        remoteBuilder.setDataLongs(3, getTimeBucket());
+
+
+        remoteBuilder.setDataIntegers(0, getId());
+        remoteBuilder.setDataIntegers(1, getServiceId());
+        remoteBuilder.setDataIntegers(2, getServiceInstanceId());
+        remoteBuilder.setDataIntegers(3, getPercentage());
+
+        return remoteBuilder;
+    }
+
+    @Override public void deserialize(RemoteData remoteData) {
+
+        setTimeBucket(remoteData.getDataLongs(0));
+        setTotal(remoteData.getDataLongs(1));
+        setMatch(remoteData.getDataLongs(2));
+        setTimeBucket(remoteData.getDataLongs(3));
+
+
+        setId(remoteData.getDataIntegers(0));
+        setServiceId(remoteData.getDataIntegers(1));
+        setServiceInstanceId(remoteData.getDataIntegers(2));
+        setPercentage(remoteData.getDataIntegers(3));
+    }
+
+    public static class Builder implements 
StorageBuilder<EndpointPercentIndicator> {
+
+        @Override public Map<String, Object> data2Map(EndpointPercentIndicator 
storageData) {
+            Map<String, Object> map = new HashMap<>();
+            map.put("id", storageData.getId());
+            map.put("service_id", storageData.getServiceId());
+            map.put("service_instance_id", storageData.getServiceInstanceId());
+            map.put("total", storageData.getTotal());
+            map.put("percentage", storageData.getPercentage());
+            map.put("match", storageData.getMatch());
+            map.put("time_bucket", storageData.getTimeBucket());
+            return map;
+        }
+
+        @Override public EndpointPercentIndicator map2Data(Map<String, Object> 
dbMap) {
+            EndpointPercentIndicator indicator = new 
EndpointPercentIndicator();
+            indicator.setId((int)dbMap.get("id"));
+            indicator.setServiceId((int)dbMap.get("service_id"));
+            
indicator.setServiceInstanceId((int)dbMap.get("service_instance_id"));
+            indicator.setTotal((long)dbMap.get("total"));
+            indicator.setPercentage((int)dbMap.get("percentage"));
+            indicator.setMatch((long)dbMap.get("match"));
+            indicator.setTimeBucket((long)dbMap.get("time_bucket"));
+            return indicator;
+        }
+    }
+}
diff --git 
a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/service/ServiceDispatcher.java
 
b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/service/ServiceDispatcher.java
new file mode 100644
index 0000000..7452ccd
--- /dev/null
+++ 
b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/generated/service/ServiceDispatcher.java
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.oap.server.core.analysis.generated.service;
+
+import org.apache.skywalking.oap.server.core.analysis.SourceDispatcher;
+import org.apache.skywalking.oap.server.core.source.Service;
+
+/**
+ * This class is auto generated. Please don't change this class manually.
+ *
+ * @author Observability Analysis Language code generator
+ */
+public class ServiceDispatcher implements SourceDispatcher<Service> {
+    @Override public void dispatch(Service source) {
+    }
+
+}
diff --git 
a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/indicator/PercentIndicator.java
 
b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/indicator/PercentIndicator.java
new file mode 100644
index 0000000..ab590e8
--- /dev/null
+++ 
b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/indicator/PercentIndicator.java
@@ -0,0 +1,59 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.oap.server.core.analysis.indicator;
+
+import lombok.Getter;
+import lombok.Setter;
+import 
org.apache.skywalking.oap.server.core.analysis.indicator.annotation.Entrance;
+import 
org.apache.skywalking.oap.server.core.analysis.indicator.annotation.Expression;
+import 
org.apache.skywalking.oap.server.core.analysis.indicator.annotation.ExpressionArg0;
+import 
org.apache.skywalking.oap.server.core.analysis.indicator.annotation.ExpressionArg1;
+import 
org.apache.skywalking.oap.server.core.analysis.indicator.annotation.IndicatorOperator;
+import 
org.apache.skywalking.oap.server.core.analysis.indicator.expression.BooleanBinaryMatch;
+import org.apache.skywalking.oap.server.core.storage.annotation.Column;
+
+/**
+ * @author wusheng
+ */
+@IndicatorOperator
+public abstract class PercentIndicator extends Indicator {
+    protected static final String TOTAL = "total";
+    protected static final String MATCH = "match";
+    protected static final String PERCENTAGE = "percentage";
+
+    @Getter @Setter @Column(columnName = TOTAL) private long total;
+    @Getter @Setter @Column(columnName = PERCENTAGE) private int percentage;
+    @Getter @Setter @Column(columnName = MATCH) private long match;
+
+    @Entrance
+    public final void combine(@Expression BooleanBinaryMatch expression, 
@ExpressionArg0 Object leftValue,
+        @ExpressionArg1 Object rightValue) {
+        expression.setLeft(leftValue);
+        expression.setRight(rightValue);
+        if (expression.match()) {
+            match++;
+        }
+        total++;
+    }
+
+    @Override public final void combine(Indicator indicator) {
+        total += ((PercentIndicator)indicator).total;
+        match += ((PercentIndicator)indicator).match;
+    }
+}
diff --git 
a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/indicator/annotation/Expression.java
 
b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/indicator/annotation/Expression.java
new file mode 100644
index 0000000..e763bc0
--- /dev/null
+++ 
b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/indicator/annotation/Expression.java
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.oap.server.core.analysis.indicator.annotation;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * @author wusheng
+ */
+@Target(ElementType.PARAMETER)
+@Retention(RetentionPolicy.RUNTIME)
+public @interface Expression {
+}
diff --git 
a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/indicator/annotation/ExpressionArg0.java
 
b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/indicator/annotation/ExpressionArg0.java
new file mode 100644
index 0000000..8bde31a
--- /dev/null
+++ 
b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/indicator/annotation/ExpressionArg0.java
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.oap.server.core.analysis.indicator.annotation;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * @author wusheng
+ */
+@Target(ElementType.PARAMETER)
+@Retention(RetentionPolicy.RUNTIME)
+public @interface ExpressionArg0 {
+}
diff --git 
a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/indicator/annotation/ExpressionArg1.java
 
b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/indicator/annotation/ExpressionArg1.java
new file mode 100644
index 0000000..70dfc9a
--- /dev/null
+++ 
b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/indicator/annotation/ExpressionArg1.java
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.oap.server.core.analysis.indicator.annotation;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * @author wusheng
+ */
+@Target(ElementType.PARAMETER)
+@Retention(RetentionPolicy.RUNTIME)
+public @interface ExpressionArg1 {
+}
diff --git 
a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/indicator/expression/BinaryMatchExpression.java
 
b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/indicator/expression/BinaryMatchExpression.java
new file mode 100644
index 0000000..ef8cc80
--- /dev/null
+++ 
b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/indicator/expression/BinaryMatchExpression.java
@@ -0,0 +1,40 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.oap.server.core.analysis.indicator.expression;
+
+/**
+ * BinaryMatchExpression accepts two calculate factors,
+ * and return the True/False result.
+ *
+ * @author wusheng
+ */
+public abstract class BinaryMatchExpression {
+    protected Object left;
+    protected Object right;
+
+    public void setLeft(Object left) {
+        this.left = left;
+    }
+
+    public void setRight(Object right) {
+        this.right = right;
+    }
+
+    public abstract boolean match();
+}
diff --git 
a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/indicator/expression/BooleanBinaryMatch.java
 
b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/indicator/expression/BooleanBinaryMatch.java
new file mode 100644
index 0000000..dc55b83
--- /dev/null
+++ 
b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/indicator/expression/BooleanBinaryMatch.java
@@ -0,0 +1,29 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.oap.server.core.analysis.indicator.expression;
+
+/**
+ *
+ * @author wusheng
+ */
+public class BooleanBinaryMatch extends BinaryMatchExpression {
+    @Override public boolean match() {
+        return left == right;
+    }
+}
diff --git 
a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/source/Service.java
 
b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/source/Service.java
new file mode 100644
index 0000000..15f28e3
--- /dev/null
+++ 
b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/source/Service.java
@@ -0,0 +1,31 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.oap.server.core.source;
+
+import org.apache.skywalking.oap.server.core.source.annotation.SourceType;
+
+/**
+ * @author wusheng
+ */
+@SourceType
+public class Service extends Source {
+    @Override public Scope scope() {
+        return Scope.Service;
+    }
+}

Reply via email to