提交 f0f4cde4 编写于 作者: 刘新元 Liu XinYuan 提交者: 彭勇升 pengys

add the methods that are not in the graphql resolver and the classes … (#1634)

* add the methods that are not in the graphql resolver and the classes that are not in the type, and resolve the StackOverFlowOver that starts the report.

* add license

* update file header
上级 b4ebb5bc
......@@ -30,7 +30,7 @@ public class AlarmQuery implements GraphQLQueryResolver {
return new AlarmTrend();
}
public Alarms getAlarm(final Duration duration, final Scope scope, final Pagination paging) {
public Alarms getAlarm(final Duration duration, final Scope scope,final String keyword, final Pagination paging) {
return new Alarms();
}
}
......@@ -47,4 +47,9 @@ public class MetadataQuery implements GraphQLQueryResolver {
public List<Endpoint> searchEndpoint(final String keyword, final String serviceId, final int limit) {
return Collections.emptyList();
}
public Service searchService(final Duration duration, final String serviceCode) {
return new Service();
}
}
......@@ -19,10 +19,7 @@
package org.apache.skywalking.oap.query.graphql.resolver;
import com.coxautodev.graphql.tools.GraphQLQueryResolver;
import org.apache.skywalking.oap.query.graphql.type.Duration;
import org.apache.skywalking.oap.query.graphql.type.LinearIntValues;
import org.apache.skywalking.oap.query.graphql.type.MetricCondition;
import org.apache.skywalking.oap.query.graphql.type.Thermodynamic;
import org.apache.skywalking.oap.query.graphql.type.*;
public class MetricQuery implements GraphQLQueryResolver {
public LinearIntValues getLinearIntValues(final MetricCondition metric, final Duration duration) {
......@@ -32,4 +29,8 @@ public class MetricQuery implements GraphQLQueryResolver {
public Thermodynamic getThermodynamic(final MetricCondition metric, final Duration duration) {
return new Thermodynamic();
}
public LinearIntValues getValues(final BatchMetricConditions metric, final Duration duration) {
return new LinearIntValues();
}
}
......@@ -22,4 +22,5 @@ public class AlarmMessage {
private Scope scope;
private String id;
private String message;
private Long startTime;
}
/*
* 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.query.graphql.type;
import java.util.List;
/**
* @author liu-xinyuan
**/
public class BatchMetricConditions {
private List<MetricCondition> metricConditions;
}
......@@ -37,4 +37,5 @@ public class Span {
private String layer;
private List<KeyValue> tags;
private List<LogEntity> logs;
private String serviceCode;
}
......@@ -50,7 +50,7 @@ public class SegmentParse implements DataStreamReader.CallBack<UpstreamSegment>
this.segmentCoreInfo = new SegmentCoreInfo();
this.segmentCoreInfo.setStartTime(Long.MAX_VALUE);
this.segmentCoreInfo.setEndTime(Long.MIN_VALUE);
this.standardizationWorker = new SegmentStandardizationWorker(moduleManager, listenerManager);
this.standardizationWorker = new SegmentStandardizationWorker(moduleManager, listenerManager,this);
}
@Override public void call(UpstreamSegment segment) {
......
......@@ -20,6 +20,7 @@ package org.apache.skywalking.oap.server.receiver.trace.provider.parser.standard
import java.io.IOException;
import java.util.*;
import org.apache.skywalking.apm.commons.datacarrier.DataCarrier;
import org.apache.skywalking.apm.commons.datacarrier.consumer.IConsumer;
import org.apache.skywalking.apm.network.language.agent.UpstreamSegment;
......@@ -40,7 +41,7 @@ public class SegmentStandardizationWorker extends AbstractWorker<SegmentStandard
private final BufferStream<UpstreamSegment> stream;
public SegmentStandardizationWorker(ModuleManager moduleManager,
SegmentParserListenerManager listenerManager) throws IOException {
SegmentParserListenerManager listenerManager, SegmentParse segmentParse) throws IOException {
super(9999);
this.dataCarrier = new DataCarrier<>(1, 1024);
this.dataCarrier.consume(new Consumer(this), 1);
......@@ -51,13 +52,14 @@ public class SegmentStandardizationWorker extends AbstractWorker<SegmentStandard
builder.dataFileMaxSize(50);
builder.offsetFileMaxSize(10);
builder.parser(UpstreamSegment.parser());
builder.callBack(new SegmentParse(moduleManager, listenerManager));
builder.callBack(segmentParse);
stream = builder.build();
stream.initialize();
}
@Override public void in(SegmentStandardization standardization) {
@Override
public void in(SegmentStandardization standardization) {
stream.write(standardization.getUpstreamSegment());
}
......@@ -69,10 +71,12 @@ public class SegmentStandardizationWorker extends AbstractWorker<SegmentStandard
this.aggregator = aggregator;
}
@Override public void init() {
@Override
public void init() {
}
@Override public void consume(List<SegmentStandardization> data) {
@Override
public void consume(List<SegmentStandardization> data) {
Iterator<SegmentStandardization> inputIterator = data.iterator();
int i = 0;
......@@ -86,11 +90,13 @@ public class SegmentStandardizationWorker extends AbstractWorker<SegmentStandard
}
}
@Override public void onError(List<SegmentStandardization> data, Throwable t) {
@Override
public void onError(List<SegmentStandardization> data, Throwable t) {
logger.error(t.getMessage(), t);
}
@Override public void onExit() {
@Override
public void onExit() {
}
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册