Application component pyramid aggregate by h2 storage test successful.
This commit is contained in:
parent
98d78f21c3
commit
3bd9e5b75d
|
|
@ -39,12 +39,12 @@ public class SegmentPost {
|
|||
serviceNameRegisterPost.send("json/servicename-register-consumer.json");
|
||||
serviceNameRegisterPost.send("json/servicename-register-provider.json");
|
||||
|
||||
// JsonElement provider = JsonFileReader.INSTANCE.read("json/dubbox-provider.json");
|
||||
// JsonElement consumer = JsonFileReader.INSTANCE.read("json/dubbox-consumer.json");
|
||||
//
|
||||
// for (int i = 0; i < 1; i++) {
|
||||
// HttpClientTools.INSTANCE.post("http://localhost:12800/segments", provider.toString());
|
||||
// HttpClientTools.INSTANCE.post("http://localhost:12800/segments", consumer.toString());
|
||||
// }
|
||||
JsonElement provider = JsonFileReader.INSTANCE.read("json/dubbox-provider.json");
|
||||
JsonElement consumer = JsonFileReader.INSTANCE.read("json/dubbox-consumer.json");
|
||||
|
||||
for (int i = 0; i < 1; i++) {
|
||||
HttpClientTools.INSTANCE.post("http://localhost:12800/segments", provider.toString());
|
||||
HttpClientTools.INSTANCE.post("http://localhost:12800/segments", consumer.toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -88,12 +88,12 @@ public class AnalysisMetricModuleProvider extends ModuleProvider {
|
|||
|
||||
private void segmentParserListenerRegister() {
|
||||
ISegmentParserListenerRegister segmentParserListenerRegister = getManager().find(AnalysisSegmentParserModule.NAME).getService(ISegmentParserListenerRegister.class);
|
||||
segmentParserListenerRegister.register(new ServiceReferenceMetricSpanListener.Factory());
|
||||
// segmentParserListenerRegister.register(new ServiceReferenceMetricSpanListener.Factory());
|
||||
segmentParserListenerRegister.register(new ApplicationComponentSpanListener.Factory());
|
||||
segmentParserListenerRegister.register(new ApplicationMappingSpanListener.Factory());
|
||||
segmentParserListenerRegister.register(new InstanceMappingSpanListener.Factory());
|
||||
segmentParserListenerRegister.register(new GlobalTraceSpanListener.Factory());
|
||||
segmentParserListenerRegister.register(new SegmentCostSpanListener.Factory());
|
||||
// segmentParserListenerRegister.register(new ApplicationMappingSpanListener.Factory());
|
||||
// segmentParserListenerRegister.register(new InstanceMappingSpanListener.Factory());
|
||||
// segmentParserListenerRegister.register(new GlobalTraceSpanListener.Factory());
|
||||
// segmentParserListenerRegister.register(new SegmentCostSpanListener.Factory());
|
||||
}
|
||||
|
||||
private void graphCreate(WorkerCreateListener workerCreateListener) {
|
||||
|
|
|
|||
|
|
@ -167,7 +167,7 @@ public class SegmentParse {
|
|||
segment.setDataBinary(dataBinary);
|
||||
segment.setTimeBucket(timeBucket);
|
||||
Graph<Segment> graph = GraphManager.INSTANCE.findGraph(GraphIdDefine.SEGMENT_PERSISTENCE_GRAPH_ID, Segment.class);
|
||||
graph.start(segment);
|
||||
// graph.start(segment);
|
||||
}
|
||||
|
||||
private void writeToBufferFile(String id, UpstreamSegment upstreamSegment) {
|
||||
|
|
|
|||
|
|
@ -26,28 +26,24 @@ public abstract class AbstractData {
|
|||
private Long[] dataLongs;
|
||||
private Double[] dataDoubles;
|
||||
private Integer[] dataIntegers;
|
||||
private Boolean[] dataBooleans;
|
||||
private byte[][] dataBytes;
|
||||
private final Column[] stringColumns;
|
||||
private final Column[] longColumns;
|
||||
private final Column[] doubleColumns;
|
||||
private final Column[] integerColumns;
|
||||
private final Column[] booleanColumns;
|
||||
private final Column[] byteColumns;
|
||||
|
||||
public AbstractData(Column[] stringColumns, Column[] longColumns, Column[] doubleColumns,
|
||||
Column[] integerColumns, Column[] booleanColumns, Column[] byteColumns) {
|
||||
Column[] integerColumns, Column[] byteColumns) {
|
||||
this.dataStrings = new String[stringColumns.length];
|
||||
this.dataLongs = new Long[longColumns.length];
|
||||
this.dataDoubles = new Double[doubleColumns.length];
|
||||
this.dataIntegers = new Integer[integerColumns.length];
|
||||
this.dataBooleans = new Boolean[booleanColumns.length];
|
||||
this.dataBytes = new byte[byteColumns.length][];
|
||||
this.stringColumns = stringColumns;
|
||||
this.longColumns = longColumns;
|
||||
this.doubleColumns = doubleColumns;
|
||||
this.integerColumns = integerColumns;
|
||||
this.booleanColumns = booleanColumns;
|
||||
this.byteColumns = byteColumns;
|
||||
}
|
||||
|
||||
|
|
@ -67,10 +63,6 @@ public abstract class AbstractData {
|
|||
return dataIntegers.length;
|
||||
}
|
||||
|
||||
public final int getDataBooleansCount() {
|
||||
return dataBooleans.length;
|
||||
}
|
||||
|
||||
public final int getDataBytesCount() {
|
||||
return dataBytes.length;
|
||||
}
|
||||
|
|
@ -91,10 +83,6 @@ public abstract class AbstractData {
|
|||
dataIntegers[position] = value;
|
||||
}
|
||||
|
||||
public final void setDataBoolean(int position, Boolean value) {
|
||||
dataBooleans[position] = value;
|
||||
}
|
||||
|
||||
public final void setDataBytes(int position, byte[] dataBytes) {
|
||||
this.dataBytes[position] = dataBytes;
|
||||
}
|
||||
|
|
@ -133,10 +121,6 @@ public abstract class AbstractData {
|
|||
}
|
||||
}
|
||||
|
||||
public final Boolean getDataBoolean(int position) {
|
||||
return dataBooleans[position];
|
||||
}
|
||||
|
||||
public final byte[] getDataBytes(int position) {
|
||||
return dataBytes[position];
|
||||
}
|
||||
|
|
@ -158,10 +142,6 @@ public abstract class AbstractData {
|
|||
Integer integerData = integerColumns[i].getOperation().operate(newData.getDataInteger(i), this.getDataInteger(i));
|
||||
this.dataIntegers[i] = integerData;
|
||||
}
|
||||
for (int i = 0; i < booleanColumns.length; i++) {
|
||||
Boolean booleanData = booleanColumns[i].getOperation().operate(newData.getDataBoolean(i), this.getDataBoolean(i));
|
||||
this.dataBooleans[i] = booleanData;
|
||||
}
|
||||
for (int i = 0; i < byteColumns.length; i++) {
|
||||
byte[] byteData = byteColumns[i].getOperation().operate(newData.getDataBytes(i), this.getDataBytes(i));
|
||||
this.dataBytes[i] = byteData;
|
||||
|
|
@ -186,10 +166,6 @@ public abstract class AbstractData {
|
|||
for (Integer dataInteger : dataIntegers) {
|
||||
dataStr.append(dataInteger).append(",");
|
||||
}
|
||||
dataStr.append("], boolean: [");
|
||||
for (Boolean dataBoolean : dataBooleans) {
|
||||
dataStr.append(dataBoolean).append(",");
|
||||
}
|
||||
dataStr.append("]");
|
||||
return dataStr.toString();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,8 +30,6 @@ public interface Data {
|
|||
|
||||
int getDataIntegersCount();
|
||||
|
||||
int getDataBooleansCount();
|
||||
|
||||
int getDataBytesCount();
|
||||
|
||||
void setDataString(int position, String value);
|
||||
|
|
@ -42,8 +40,6 @@ public interface Data {
|
|||
|
||||
void setDataInteger(int position, Integer value);
|
||||
|
||||
void setDataBoolean(int position, Boolean value);
|
||||
|
||||
void setDataBytes(int position, byte[] dataBytes);
|
||||
|
||||
String getDataString(int position);
|
||||
|
|
@ -54,7 +50,5 @@ public interface Data {
|
|||
|
||||
Integer getDataInteger(int position);
|
||||
|
||||
Boolean getDataBoolean(int position);
|
||||
|
||||
byte[] getDataBytes(int position);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,8 +36,8 @@ public abstract class StreamData extends AbstractData implements RemoteData, Que
|
|||
}
|
||||
|
||||
public StreamData(Column[] stringColumns, Column[] longColumns, Column[] doubleColumns,
|
||||
Column[] integerColumns, Column[] booleanColumns, Column[] byteColumns) {
|
||||
super(stringColumns, longColumns, doubleColumns, integerColumns, booleanColumns, byteColumns);
|
||||
Column[] integerColumns, Column[] byteColumns) {
|
||||
super(stringColumns, longColumns, doubleColumns, integerColumns, byteColumns);
|
||||
}
|
||||
|
||||
@Override public final String selectKey() {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,48 @@
|
|||
/*
|
||||
* 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.apm.collector.core.util;
|
||||
|
||||
import org.apache.skywalking.apm.collector.core.UnexpectedException;
|
||||
|
||||
/**
|
||||
* @author peng-yongsheng
|
||||
*/
|
||||
public class BooleanUtils {
|
||||
|
||||
public static final Integer TRUE = 1;
|
||||
public static final Integer FALSE = 0;
|
||||
|
||||
public static boolean valueToBoolean(Integer value) {
|
||||
if (TRUE.equals(value)) {
|
||||
return true;
|
||||
} else if (FALSE.equals(value)) {
|
||||
return false;
|
||||
} else {
|
||||
throw new UnexpectedException("Boolean value error, must be 0 or 1");
|
||||
}
|
||||
}
|
||||
|
||||
public static Integer booleanToValue(Boolean booleanValue) {
|
||||
if (booleanValue) {
|
||||
return TRUE;
|
||||
} else {
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -37,9 +37,6 @@ public class GRPCRemoteDeserializeService implements RemoteDeserializeService<Re
|
|||
for (int i = 0; i < remoteData.getDataLongsCount(); i++) {
|
||||
data.setDataLong(i, remoteData.getDataLongs(i));
|
||||
}
|
||||
for (int i = 0; i < remoteData.getDataBooleansCount(); i++) {
|
||||
data.setDataBoolean(i, remoteData.getDataBooleans(i));
|
||||
}
|
||||
for (int i = 0; i < remoteData.getDataDoublesCount(); i++) {
|
||||
data.setDataDouble(i, remoteData.getDataDoubles(i));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,15 +37,9 @@ public class GRPCRemoteSerializeService implements RemoteSerializeService<Remote
|
|||
for (int i = 0; i < data.getDataLongsCount(); i++) {
|
||||
builder.addDataLongs(data.getDataLong(i));
|
||||
}
|
||||
for (int i = 0; i < data.getDataBooleansCount(); i++) {
|
||||
builder.addDataBooleans(data.getDataBoolean(i));
|
||||
}
|
||||
for (int i = 0; i < data.getDataDoublesCount(); i++) {
|
||||
builder.addDataDoubles(data.getDataDouble(i));
|
||||
}
|
||||
for (int i = 0; i < data.getDataBytesCount(); i++) {
|
||||
// builder.addDataBytes(ByteString.copyFrom(data.getDataBytes(i)));
|
||||
}
|
||||
return builder;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,6 +35,10 @@ import org.apache.skywalking.apm.collector.storage.dao.IMemoryPoolMetricUIDAO;
|
|||
import org.apache.skywalking.apm.collector.storage.dao.ISegmentCostUIDAO;
|
||||
import org.apache.skywalking.apm.collector.storage.dao.ISegmentUIDAO;
|
||||
import org.apache.skywalking.apm.collector.storage.dao.IServiceReferenceUIDAO;
|
||||
import org.apache.skywalking.apm.collector.storage.dao.acp.IApplicationComponentDayPersistenceDAO;
|
||||
import org.apache.skywalking.apm.collector.storage.dao.acp.IApplicationComponentHourPersistenceDAO;
|
||||
import org.apache.skywalking.apm.collector.storage.dao.acp.IApplicationComponentMinutePersistenceDAO;
|
||||
import org.apache.skywalking.apm.collector.storage.dao.acp.IApplicationComponentMonthPersistenceDAO;
|
||||
import org.apache.skywalking.apm.collector.storage.dao.cache.IApplicationCacheDAO;
|
||||
import org.apache.skywalking.apm.collector.storage.dao.cache.IInstanceCacheDAO;
|
||||
import org.apache.skywalking.apm.collector.storage.dao.cache.INetworkAddressCacheDAO;
|
||||
|
|
@ -127,11 +131,11 @@ public class StorageModule extends Module {
|
|||
classes.add(IMemoryPoolDayMetricPersistenceDAO.class);
|
||||
classes.add(IMemoryPoolMonthMetricPersistenceDAO.class);
|
||||
|
||||
// classes.add(IApplicationComponentMinutePersistenceDAO.class);
|
||||
// classes.add(IApplicationComponentHourPersistenceDAO.class);
|
||||
// classes.add(IApplicationComponentDayPersistenceDAO.class);
|
||||
// classes.add(IApplicationComponentMonthPersistenceDAO.class);
|
||||
//
|
||||
classes.add(IApplicationComponentMinutePersistenceDAO.class);
|
||||
classes.add(IApplicationComponentHourPersistenceDAO.class);
|
||||
classes.add(IApplicationComponentDayPersistenceDAO.class);
|
||||
classes.add(IApplicationComponentMonthPersistenceDAO.class);
|
||||
|
||||
// classes.add(IApplicationMappingMinutePersistenceDAO.class);
|
||||
// classes.add(IApplicationMappingHourPersistenceDAO.class);
|
||||
// classes.add(IApplicationMappingDayPersistenceDAO.class);
|
||||
|
|
|
|||
|
|
@ -45,12 +45,10 @@ public class ApplicationAlarm extends StreamData implements Alarm {
|
|||
new Column(ApplicationAlarmTable.COLUMN_APPLICATION_ID, new NonOperation()),
|
||||
};
|
||||
|
||||
private static final Column[] BOOLEAN_COLUMNS = {};
|
||||
|
||||
private static final Column[] BYTE_COLUMNS = {};
|
||||
|
||||
public ApplicationAlarm() {
|
||||
super(STRING_COLUMNS, LONG_COLUMNS, DOUBLE_COLUMNS, INTEGER_COLUMNS, BOOLEAN_COLUMNS, BYTE_COLUMNS);
|
||||
super(STRING_COLUMNS, LONG_COLUMNS, DOUBLE_COLUMNS, INTEGER_COLUMNS, BYTE_COLUMNS);
|
||||
}
|
||||
|
||||
@Override public String getId() {
|
||||
|
|
|
|||
|
|
@ -45,12 +45,10 @@ public class ApplicationAlarmList extends StreamData {
|
|||
new Column(ApplicationAlarmListTable.COLUMN_APPLICATION_ID, new NonOperation()),
|
||||
};
|
||||
|
||||
private static final Column[] BOOLEAN_COLUMNS = {};
|
||||
|
||||
private static final Column[] BYTE_COLUMNS = {};
|
||||
|
||||
public ApplicationAlarmList() {
|
||||
super(STRING_COLUMNS, LONG_COLUMNS, DOUBLE_COLUMNS, INTEGER_COLUMNS, BOOLEAN_COLUMNS, BYTE_COLUMNS);
|
||||
super(STRING_COLUMNS, LONG_COLUMNS, DOUBLE_COLUMNS, INTEGER_COLUMNS, BYTE_COLUMNS);
|
||||
}
|
||||
|
||||
@Override public String getId() {
|
||||
|
|
|
|||
|
|
@ -46,12 +46,10 @@ public class ApplicationReferenceAlarm extends StreamData implements Alarm {
|
|||
new Column(ApplicationReferenceAlarmTable.COLUMN_BEHIND_APPLICATION_ID, new NonOperation()),
|
||||
};
|
||||
|
||||
private static final Column[] BOOLEAN_COLUMNS = {};
|
||||
|
||||
private static final Column[] BYTE_COLUMNS = {};
|
||||
|
||||
public ApplicationReferenceAlarm() {
|
||||
super(STRING_COLUMNS, LONG_COLUMNS, DOUBLE_COLUMNS, INTEGER_COLUMNS, BOOLEAN_COLUMNS, BYTE_COLUMNS);
|
||||
super(STRING_COLUMNS, LONG_COLUMNS, DOUBLE_COLUMNS, INTEGER_COLUMNS, BYTE_COLUMNS);
|
||||
}
|
||||
|
||||
@Override public String getId() {
|
||||
|
|
|
|||
|
|
@ -46,12 +46,10 @@ public class ApplicationReferenceAlarmList extends StreamData {
|
|||
new Column(ApplicationReferenceAlarmListTable.COLUMN_BEHIND_APPLICATION_ID, new NonOperation()),
|
||||
};
|
||||
|
||||
private static final Column[] BOOLEAN_COLUMNS = {};
|
||||
|
||||
private static final Column[] BYTE_COLUMNS = {};
|
||||
|
||||
public ApplicationReferenceAlarmList() {
|
||||
super(STRING_COLUMNS, LONG_COLUMNS, DOUBLE_COLUMNS, INTEGER_COLUMNS, BOOLEAN_COLUMNS, BYTE_COLUMNS);
|
||||
super(STRING_COLUMNS, LONG_COLUMNS, DOUBLE_COLUMNS, INTEGER_COLUMNS, BYTE_COLUMNS);
|
||||
}
|
||||
|
||||
@Override public String getId() {
|
||||
|
|
|
|||
|
|
@ -46,12 +46,10 @@ public class InstanceAlarm extends StreamData implements Alarm {
|
|||
new Column(InstanceAlarmTable.COLUMN_INSTANCE_ID, new NonOperation()),
|
||||
};
|
||||
|
||||
private static final Column[] BOOLEAN_COLUMNS = {};
|
||||
|
||||
private static final Column[] BYTE_COLUMNS = {};
|
||||
|
||||
public InstanceAlarm() {
|
||||
super(STRING_COLUMNS, LONG_COLUMNS, DOUBLE_COLUMNS, INTEGER_COLUMNS, BOOLEAN_COLUMNS, BYTE_COLUMNS);
|
||||
super(STRING_COLUMNS, LONG_COLUMNS, DOUBLE_COLUMNS, INTEGER_COLUMNS, BYTE_COLUMNS);
|
||||
}
|
||||
|
||||
@Override public String getId() {
|
||||
|
|
|
|||
|
|
@ -46,12 +46,10 @@ public class InstanceAlarmList extends StreamData {
|
|||
new Column(InstanceAlarmListTable.COLUMN_INSTANCE_ID, new NonOperation()),
|
||||
};
|
||||
|
||||
private static final Column[] BOOLEAN_COLUMNS = {};
|
||||
|
||||
private static final Column[] BYTE_COLUMNS = {};
|
||||
|
||||
public InstanceAlarmList() {
|
||||
super(STRING_COLUMNS, LONG_COLUMNS, DOUBLE_COLUMNS, INTEGER_COLUMNS, BOOLEAN_COLUMNS, BYTE_COLUMNS);
|
||||
super(STRING_COLUMNS, LONG_COLUMNS, DOUBLE_COLUMNS, INTEGER_COLUMNS, BYTE_COLUMNS);
|
||||
}
|
||||
|
||||
@Override public String getId() {
|
||||
|
|
|
|||
|
|
@ -48,12 +48,10 @@ public class InstanceReferenceAlarm extends StreamData implements Alarm {
|
|||
new Column(InstanceReferenceAlarmTable.COLUMN_BEHIND_INSTANCE_ID, new NonOperation()),
|
||||
};
|
||||
|
||||
private static final Column[] BOOLEAN_COLUMNS = {};
|
||||
|
||||
private static final Column[] BYTE_COLUMNS = {};
|
||||
|
||||
public InstanceReferenceAlarm() {
|
||||
super(STRING_COLUMNS, LONG_COLUMNS, DOUBLE_COLUMNS, INTEGER_COLUMNS, BOOLEAN_COLUMNS, BYTE_COLUMNS);
|
||||
super(STRING_COLUMNS, LONG_COLUMNS, DOUBLE_COLUMNS, INTEGER_COLUMNS, BYTE_COLUMNS);
|
||||
}
|
||||
|
||||
@Override public String getId() {
|
||||
|
|
|
|||
|
|
@ -48,12 +48,10 @@ public class InstanceReferenceAlarmList extends StreamData {
|
|||
new Column(InstanceReferenceAlarmListTable.COLUMN_BEHIND_INSTANCE_ID, new NonOperation()),
|
||||
};
|
||||
|
||||
private static final Column[] BOOLEAN_COLUMNS = {};
|
||||
|
||||
private static final Column[] BYTE_COLUMNS = {};
|
||||
|
||||
public InstanceReferenceAlarmList() {
|
||||
super(STRING_COLUMNS, LONG_COLUMNS, DOUBLE_COLUMNS, INTEGER_COLUMNS, BOOLEAN_COLUMNS, BYTE_COLUMNS);
|
||||
super(STRING_COLUMNS, LONG_COLUMNS, DOUBLE_COLUMNS, INTEGER_COLUMNS, BYTE_COLUMNS);
|
||||
}
|
||||
|
||||
@Override public String getId() {
|
||||
|
|
|
|||
|
|
@ -47,12 +47,10 @@ public class ServiceAlarm extends StreamData implements Alarm {
|
|||
new Column(ServiceAlarmTable.COLUMN_SERVICE_ID, new NonOperation()),
|
||||
};
|
||||
|
||||
private static final Column[] BOOLEAN_COLUMNS = {};
|
||||
|
||||
private static final Column[] BYTE_COLUMNS = {};
|
||||
|
||||
public ServiceAlarm() {
|
||||
super(STRING_COLUMNS, LONG_COLUMNS, DOUBLE_COLUMNS, INTEGER_COLUMNS, BOOLEAN_COLUMNS, BYTE_COLUMNS);
|
||||
super(STRING_COLUMNS, LONG_COLUMNS, DOUBLE_COLUMNS, INTEGER_COLUMNS, BYTE_COLUMNS);
|
||||
}
|
||||
|
||||
@Override public String getId() {
|
||||
|
|
|
|||
|
|
@ -47,12 +47,10 @@ public class ServiceAlarmList extends StreamData {
|
|||
new Column(ServiceAlarmListTable.COLUMN_SERVICE_ID, new NonOperation()),
|
||||
};
|
||||
|
||||
private static final Column[] BOOLEAN_COLUMNS = {};
|
||||
|
||||
private static final Column[] BYTE_COLUMNS = {};
|
||||
|
||||
public ServiceAlarmList() {
|
||||
super(STRING_COLUMNS, LONG_COLUMNS, DOUBLE_COLUMNS, INTEGER_COLUMNS, BOOLEAN_COLUMNS, BYTE_COLUMNS);
|
||||
super(STRING_COLUMNS, LONG_COLUMNS, DOUBLE_COLUMNS, INTEGER_COLUMNS, BYTE_COLUMNS);
|
||||
}
|
||||
|
||||
@Override public String getId() {
|
||||
|
|
|
|||
|
|
@ -50,12 +50,10 @@ public class ServiceReferenceAlarm extends StreamData implements Alarm {
|
|||
new Column(ServiceReferenceAlarmTable.COLUMN_BEHIND_SERVICE_ID, new NonOperation()),
|
||||
};
|
||||
|
||||
private static final Column[] BOOLEAN_COLUMNS = {};
|
||||
|
||||
private static final Column[] BYTE_COLUMNS = {};
|
||||
|
||||
public ServiceReferenceAlarm() {
|
||||
super(STRING_COLUMNS, LONG_COLUMNS, DOUBLE_COLUMNS, INTEGER_COLUMNS, BOOLEAN_COLUMNS, BYTE_COLUMNS);
|
||||
super(STRING_COLUMNS, LONG_COLUMNS, DOUBLE_COLUMNS, INTEGER_COLUMNS, BYTE_COLUMNS);
|
||||
}
|
||||
|
||||
@Override public String getId() {
|
||||
|
|
|
|||
|
|
@ -50,12 +50,10 @@ public class ServiceReferenceAlarmList extends StreamData {
|
|||
new Column(ServiceReferenceAlarmListTable.COLUMN_BEHIND_SERVICE_ID, new NonOperation()),
|
||||
};
|
||||
|
||||
private static final Column[] BOOLEAN_COLUMNS = {};
|
||||
|
||||
private static final Column[] BYTE_COLUMNS = {};
|
||||
|
||||
public ServiceReferenceAlarmList() {
|
||||
super(STRING_COLUMNS, LONG_COLUMNS, DOUBLE_COLUMNS, INTEGER_COLUMNS, BOOLEAN_COLUMNS, BYTE_COLUMNS);
|
||||
super(STRING_COLUMNS, LONG_COLUMNS, DOUBLE_COLUMNS, INTEGER_COLUMNS, BYTE_COLUMNS);
|
||||
}
|
||||
|
||||
@Override public String getId() {
|
||||
|
|
|
|||
|
|
@ -44,12 +44,10 @@ public class ApplicationComponent extends StreamData {
|
|||
new Column(ApplicationComponentTable.COLUMN_PEER_ID, new CoverOperation()),
|
||||
};
|
||||
|
||||
private static final Column[] BOOLEAN_COLUMNS = {};
|
||||
|
||||
private static final Column[] BYTE_COLUMNS = {};
|
||||
|
||||
public ApplicationComponent() {
|
||||
super(STRING_COLUMNS, LONG_COLUMNS, DOUBLE_COLUMNS, INTEGER_COLUMNS, BOOLEAN_COLUMNS, BYTE_COLUMNS);
|
||||
super(STRING_COLUMNS, LONG_COLUMNS, DOUBLE_COLUMNS, INTEGER_COLUMNS, BYTE_COLUMNS);
|
||||
}
|
||||
|
||||
@Override public String getId() {
|
||||
|
|
|
|||
|
|
@ -44,12 +44,10 @@ public class ApplicationMapping extends StreamData {
|
|||
new Column(ApplicationMappingTable.COLUMN_ADDRESS_ID, new CoverOperation()),
|
||||
};
|
||||
|
||||
private static final Column[] BOOLEAN_COLUMNS = {};
|
||||
|
||||
private static final Column[] BYTE_COLUMNS = {};
|
||||
|
||||
public ApplicationMapping() {
|
||||
super(STRING_COLUMNS, LONG_COLUMNS, DOUBLE_COLUMNS, INTEGER_COLUMNS, BOOLEAN_COLUMNS, BYTE_COLUMNS);
|
||||
super(STRING_COLUMNS, LONG_COLUMNS, DOUBLE_COLUMNS, INTEGER_COLUMNS, BYTE_COLUMNS);
|
||||
}
|
||||
|
||||
@Override public String getId() {
|
||||
|
|
|
|||
|
|
@ -61,12 +61,10 @@ public class ApplicationMetric extends StreamData implements Metric {
|
|||
new Column(ApplicationMetricTable.COLUMN_APPLICATION_ID, new NonOperation()),
|
||||
};
|
||||
|
||||
private static final Column[] BOOLEAN_COLUMNS = {};
|
||||
|
||||
private static final Column[] BYTE_COLUMNS = {};
|
||||
|
||||
public ApplicationMetric() {
|
||||
super(STRING_COLUMNS, LONG_COLUMNS, DOUBLE_COLUMNS, INTEGER_COLUMNS, BOOLEAN_COLUMNS, BYTE_COLUMNS);
|
||||
super(STRING_COLUMNS, LONG_COLUMNS, DOUBLE_COLUMNS, INTEGER_COLUMNS, BYTE_COLUMNS);
|
||||
}
|
||||
|
||||
@Override public String getId() {
|
||||
|
|
|
|||
|
|
@ -62,12 +62,10 @@ public class ApplicationReferenceMetric extends StreamData implements Metric {
|
|||
new Column(ApplicationReferenceMetricTable.COLUMN_BEHIND_APPLICATION_ID, new NonOperation()),
|
||||
};
|
||||
|
||||
private static final Column[] BOOLEAN_COLUMNS = {};
|
||||
|
||||
private static final Column[] BYTE_COLUMNS = {};
|
||||
|
||||
public ApplicationReferenceMetric() {
|
||||
super(STRING_COLUMNS, LONG_COLUMNS, DOUBLE_COLUMNS, INTEGER_COLUMNS, BOOLEAN_COLUMNS, BYTE_COLUMNS);
|
||||
super(STRING_COLUMNS, LONG_COLUMNS, DOUBLE_COLUMNS, INTEGER_COLUMNS, BYTE_COLUMNS);
|
||||
}
|
||||
|
||||
@Override public String getId() {
|
||||
|
|
|
|||
|
|
@ -37,15 +37,16 @@ public class GlobalTrace extends StreamData {
|
|||
private static final Column[] LONG_COLUMNS = {
|
||||
new Column(GlobalTraceTable.COLUMN_TIME_BUCKET, new CoverOperation()),
|
||||
};
|
||||
|
||||
private static final Column[] DOUBLE_COLUMNS = {};
|
||||
|
||||
private static final Column[] INTEGER_COLUMNS = {
|
||||
};
|
||||
|
||||
private static final Column[] BOOLEAN_COLUMNS = {};
|
||||
private static final Column[] BYTE_COLUMNS = {};
|
||||
|
||||
public GlobalTrace() {
|
||||
super(STRING_COLUMNS, LONG_COLUMNS, DOUBLE_COLUMNS, INTEGER_COLUMNS, BOOLEAN_COLUMNS, BYTE_COLUMNS);
|
||||
super(STRING_COLUMNS, LONG_COLUMNS, DOUBLE_COLUMNS, INTEGER_COLUMNS, BYTE_COLUMNS);
|
||||
}
|
||||
|
||||
@Override public String getId() {
|
||||
|
|
|
|||
|
|
@ -45,12 +45,10 @@ public class InstanceMapping extends StreamData {
|
|||
new Column(InstanceMappingTable.COLUMN_ADDRESS_ID, new CoverOperation()),
|
||||
};
|
||||
|
||||
private static final Column[] BOOLEAN_COLUMNS = {};
|
||||
|
||||
private static final Column[] BYTE_COLUMNS = {};
|
||||
|
||||
public InstanceMapping() {
|
||||
super(STRING_COLUMNS, LONG_COLUMNS, DOUBLE_COLUMNS, INTEGER_COLUMNS, BOOLEAN_COLUMNS, BYTE_COLUMNS);
|
||||
super(STRING_COLUMNS, LONG_COLUMNS, DOUBLE_COLUMNS, INTEGER_COLUMNS, BYTE_COLUMNS);
|
||||
}
|
||||
|
||||
@Override public String getId() {
|
||||
|
|
|
|||
|
|
@ -60,12 +60,10 @@ public class InstanceMetric extends StreamData implements Metric {
|
|||
new Column(InstanceMetricTable.COLUMN_INSTANCE_ID, new CoverOperation()),
|
||||
};
|
||||
|
||||
private static final Column[] BOOLEAN_COLUMNS = {};
|
||||
|
||||
private static final Column[] BYTE_COLUMNS = {};
|
||||
|
||||
public InstanceMetric() {
|
||||
super(STRING_COLUMNS, LONG_COLUMNS, DOUBLE_COLUMNS, INTEGER_COLUMNS, BOOLEAN_COLUMNS, BYTE_COLUMNS);
|
||||
super(STRING_COLUMNS, LONG_COLUMNS, DOUBLE_COLUMNS, INTEGER_COLUMNS, BYTE_COLUMNS);
|
||||
}
|
||||
|
||||
@Override public String getId() {
|
||||
|
|
|
|||
|
|
@ -61,12 +61,10 @@ public class InstanceReferenceMetric extends StreamData implements Metric {
|
|||
new Column(InstanceReferenceMetricTable.COLUMN_BEHIND_INSTANCE_ID, new NonOperation()),
|
||||
};
|
||||
|
||||
private static final Column[] BOOLEAN_COLUMNS = {};
|
||||
|
||||
private static final Column[] BYTE_COLUMNS = {};
|
||||
|
||||
public InstanceReferenceMetric() {
|
||||
super(STRING_COLUMNS, LONG_COLUMNS, DOUBLE_COLUMNS, INTEGER_COLUMNS, BOOLEAN_COLUMNS, BYTE_COLUMNS);
|
||||
super(STRING_COLUMNS, LONG_COLUMNS, DOUBLE_COLUMNS, INTEGER_COLUMNS, BYTE_COLUMNS);
|
||||
}
|
||||
|
||||
@Override public String getId() {
|
||||
|
|
|
|||
|
|
@ -47,11 +47,10 @@ public class CpuMetric extends StreamData {
|
|||
new Column(CpuMetricTable.COLUMN_INSTANCE_ID, new CoverOperation()),
|
||||
};
|
||||
|
||||
private static final Column[] BOOLEAN_COLUMNS = {};
|
||||
private static final Column[] BYTE_COLUMNS = {};
|
||||
|
||||
public CpuMetric() {
|
||||
super(STRING_COLUMNS, LONG_COLUMNS, DOUBLE_COLUMNS, INTEGER_COLUMNS, BOOLEAN_COLUMNS, BYTE_COLUMNS);
|
||||
super(STRING_COLUMNS, LONG_COLUMNS, DOUBLE_COLUMNS, INTEGER_COLUMNS, BYTE_COLUMNS);
|
||||
}
|
||||
|
||||
@Override public String getId() {
|
||||
|
|
|
|||
|
|
@ -48,11 +48,10 @@ public class GCMetric extends StreamData {
|
|||
new Column(GCMetricTable.COLUMN_PHRASE, new CoverOperation()),
|
||||
};
|
||||
|
||||
private static final Column[] BOOLEAN_COLUMNS = {};
|
||||
private static final Column[] BYTE_COLUMNS = {};
|
||||
|
||||
public GCMetric() {
|
||||
super(STRING_COLUMNS, LONG_COLUMNS, DOUBLE_COLUMNS, INTEGER_COLUMNS, BOOLEAN_COLUMNS, BYTE_COLUMNS);
|
||||
super(STRING_COLUMNS, LONG_COLUMNS, DOUBLE_COLUMNS, INTEGER_COLUMNS, BYTE_COLUMNS);
|
||||
}
|
||||
|
||||
@Override public String getId() {
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@ import org.apache.skywalking.apm.collector.core.data.operator.CoverOperation;
|
|||
import org.apache.skywalking.apm.collector.core.data.operator.MaxOperation;
|
||||
import org.apache.skywalking.apm.collector.core.data.operator.MinOperation;
|
||||
import org.apache.skywalking.apm.collector.core.data.operator.NonOperation;
|
||||
import org.apache.skywalking.apm.collector.core.util.BooleanUtils;
|
||||
|
||||
/**
|
||||
* @author peng-yongsheng
|
||||
|
|
@ -50,15 +51,13 @@ public class MemoryMetric extends StreamData {
|
|||
|
||||
private static final Column[] INTEGER_COLUMNS = {
|
||||
new Column(MemoryMetricTable.COLUMN_INSTANCE_ID, new CoverOperation()),
|
||||
};
|
||||
|
||||
private static final Column[] BOOLEAN_COLUMNS = {
|
||||
new Column(MemoryMetricTable.COLUMN_IS_HEAP, new CoverOperation()),
|
||||
};
|
||||
|
||||
private static final Column[] BYTE_COLUMNS = {};
|
||||
|
||||
public MemoryMetric() {
|
||||
super(STRING_COLUMNS, LONG_COLUMNS, DOUBLE_COLUMNS, INTEGER_COLUMNS, BOOLEAN_COLUMNS, BYTE_COLUMNS);
|
||||
super(STRING_COLUMNS, LONG_COLUMNS, DOUBLE_COLUMNS, INTEGER_COLUMNS, BYTE_COLUMNS);
|
||||
}
|
||||
|
||||
@Override public String getId() {
|
||||
|
|
@ -125,14 +124,6 @@ public class MemoryMetric extends StreamData {
|
|||
setDataLong(5, timeBucket);
|
||||
}
|
||||
|
||||
public Boolean getIsHeap() {
|
||||
return getDataBoolean(0);
|
||||
}
|
||||
|
||||
public void setIsHeap(Boolean isHeap) {
|
||||
setDataBoolean(0, isHeap);
|
||||
}
|
||||
|
||||
public Integer getInstanceId() {
|
||||
return getDataInteger(0);
|
||||
}
|
||||
|
|
@ -140,4 +131,12 @@ public class MemoryMetric extends StreamData {
|
|||
public void setInstanceId(Integer instanceId) {
|
||||
setDataInteger(0, instanceId);
|
||||
}
|
||||
|
||||
public Boolean getIsHeap() {
|
||||
return BooleanUtils.valueToBoolean(getDataInteger(1));
|
||||
}
|
||||
|
||||
public void setIsHeap(Boolean isHeap) {
|
||||
setDataInteger(1, BooleanUtils.booleanToValue(isHeap));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -53,12 +53,10 @@ public class MemoryPoolMetric extends StreamData {
|
|||
new Column(MemoryPoolMetricTable.COLUMN_POOL_TYPE, new CoverOperation()),
|
||||
};
|
||||
|
||||
private static final Column[] BOOLEAN_COLUMNS = {};
|
||||
|
||||
private static final Column[] BYTE_COLUMNS = {};
|
||||
|
||||
public MemoryPoolMetric() {
|
||||
super(STRING_COLUMNS, LONG_COLUMNS, DOUBLE_COLUMNS, INTEGER_COLUMNS, BOOLEAN_COLUMNS, BYTE_COLUMNS);
|
||||
super(STRING_COLUMNS, LONG_COLUMNS, DOUBLE_COLUMNS, INTEGER_COLUMNS, BYTE_COLUMNS);
|
||||
}
|
||||
|
||||
@Override public String getId() {
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ import org.apache.skywalking.apm.collector.core.data.Column;
|
|||
import org.apache.skywalking.apm.collector.core.data.StreamData;
|
||||
import org.apache.skywalking.apm.collector.core.data.operator.CoverOperation;
|
||||
import org.apache.skywalking.apm.collector.core.data.operator.NonOperation;
|
||||
import org.apache.skywalking.apm.collector.core.util.BooleanUtils;
|
||||
|
||||
/**
|
||||
* @author peng-yongsheng
|
||||
|
|
@ -40,16 +41,13 @@ public class Application extends StreamData {
|
|||
private static final Column[] INTEGER_COLUMNS = {
|
||||
new Column(ApplicationTable.COLUMN_APPLICATION_ID, new CoverOperation()),
|
||||
new Column(ApplicationTable.COLUMN_ADDRESS_ID, new CoverOperation()),
|
||||
};
|
||||
|
||||
private static final Column[] BOOLEAN_COLUMNS = {
|
||||
new Column(ApplicationTable.COLUMN_IS_ADDRESS, new CoverOperation()),
|
||||
};
|
||||
|
||||
private static final Column[] BYTE_COLUMNS = {};
|
||||
|
||||
public Application() {
|
||||
super(STRING_COLUMNS, LONG_COLUMNS, DOUBLE_COLUMNS, INTEGER_COLUMNS, BOOLEAN_COLUMNS, BYTE_COLUMNS);
|
||||
super(STRING_COLUMNS, LONG_COLUMNS, DOUBLE_COLUMNS, INTEGER_COLUMNS, BYTE_COLUMNS);
|
||||
}
|
||||
|
||||
@Override public String getId() {
|
||||
|
|
@ -93,10 +91,10 @@ public class Application extends StreamData {
|
|||
}
|
||||
|
||||
public boolean getIsAddress() {
|
||||
return getDataBoolean(0);
|
||||
return BooleanUtils.valueToBoolean(getDataInteger(2));
|
||||
}
|
||||
|
||||
public void setIsAddress(boolean isAddress) {
|
||||
setDataBoolean(0, isAddress);
|
||||
setDataInteger(2, BooleanUtils.booleanToValue(isAddress));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ import org.apache.skywalking.apm.collector.core.data.Column;
|
|||
import org.apache.skywalking.apm.collector.core.data.StreamData;
|
||||
import org.apache.skywalking.apm.collector.core.data.operator.CoverOperation;
|
||||
import org.apache.skywalking.apm.collector.core.data.operator.NonOperation;
|
||||
import org.apache.skywalking.apm.collector.core.util.BooleanUtils;
|
||||
|
||||
/**
|
||||
* @author peng-yongsheng
|
||||
|
|
@ -45,16 +46,13 @@ public class Instance extends StreamData {
|
|||
new Column(InstanceTable.COLUMN_APPLICATION_ID, new CoverOperation()),
|
||||
new Column(InstanceTable.COLUMN_INSTANCE_ID, new CoverOperation()),
|
||||
new Column(InstanceTable.COLUMN_ADDRESS_ID, new CoverOperation()),
|
||||
};
|
||||
|
||||
private static final Column[] BOOLEAN_COLUMNS = {
|
||||
new Column(InstanceTable.COLUMN_IS_ADDRESS, new CoverOperation()),
|
||||
};
|
||||
|
||||
private static final Column[] BYTE_COLUMNS = {};
|
||||
|
||||
public Instance() {
|
||||
super(STRING_COLUMNS, LONG_COLUMNS, DOUBLE_COLUMNS, INTEGER_COLUMNS, BOOLEAN_COLUMNS, BYTE_COLUMNS);
|
||||
super(STRING_COLUMNS, LONG_COLUMNS, DOUBLE_COLUMNS, INTEGER_COLUMNS, BYTE_COLUMNS);
|
||||
}
|
||||
|
||||
@Override public String getId() {
|
||||
|
|
@ -130,10 +128,10 @@ public class Instance extends StreamData {
|
|||
}
|
||||
|
||||
public boolean getIsAddress() {
|
||||
return getDataBoolean(0);
|
||||
return BooleanUtils.valueToBoolean(getDataInteger(3));
|
||||
}
|
||||
|
||||
public void setIsAddress(boolean isAddress) {
|
||||
setDataBoolean(0, isAddress);
|
||||
setDataInteger(3, BooleanUtils.booleanToValue(isAddress));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -41,12 +41,10 @@ public class NetworkAddress extends StreamData {
|
|||
new Column(NetworkAddressTable.COLUMN_ADDRESS_ID, new NonOperation()),
|
||||
};
|
||||
|
||||
private static final Column[] BOOLEAN_COLUMNS = {};
|
||||
|
||||
private static final Column[] BYTE_COLUMNS = {};
|
||||
|
||||
public NetworkAddress() {
|
||||
super(STRING_COLUMNS, LONG_COLUMNS, DOUBLE_COLUMNS, INTEGER_COLUMNS, BOOLEAN_COLUMNS, BYTE_COLUMNS);
|
||||
super(STRING_COLUMNS, LONG_COLUMNS, DOUBLE_COLUMNS, INTEGER_COLUMNS, BYTE_COLUMNS);
|
||||
}
|
||||
|
||||
@Override public String getId() {
|
||||
|
|
|
|||
|
|
@ -34,17 +34,18 @@ public class ServiceName extends StreamData {
|
|||
};
|
||||
|
||||
private static final Column[] LONG_COLUMNS = {};
|
||||
|
||||
private static final Column[] DOUBLE_COLUMNS = {};
|
||||
|
||||
private static final Column[] INTEGER_COLUMNS = {
|
||||
new Column(ServiceNameTable.COLUMN_APPLICATION_ID, new CoverOperation()),
|
||||
new Column(ServiceNameTable.COLUMN_SERVICE_ID, new CoverOperation()),
|
||||
};
|
||||
|
||||
private static final Column[] BOOLEAN_COLUMNS = {};
|
||||
private static final Column[] BYTE_COLUMNS = {};
|
||||
|
||||
public ServiceName() {
|
||||
super(STRING_COLUMNS, LONG_COLUMNS, DOUBLE_COLUMNS, INTEGER_COLUMNS, BOOLEAN_COLUMNS, BYTE_COLUMNS);
|
||||
super(STRING_COLUMNS, LONG_COLUMNS, DOUBLE_COLUMNS, INTEGER_COLUMNS, BYTE_COLUMNS);
|
||||
}
|
||||
|
||||
@Override public String getId() {
|
||||
|
|
|
|||
|
|
@ -35,17 +35,18 @@ public class Segment extends StreamData {
|
|||
private static final Column[] LONG_COLUMNS = {
|
||||
new Column(SegmentTable.COLUMN_TIME_BUCKET, new NonOperation()),
|
||||
};
|
||||
|
||||
private static final Column[] DOUBLE_COLUMNS = {};
|
||||
|
||||
private static final Column[] INTEGER_COLUMNS = {
|
||||
};
|
||||
|
||||
private static final Column[] BOOLEAN_COLUMNS = {};
|
||||
private static final Column[] BYTE_COLUMNS = {
|
||||
new Column(SegmentTable.COLUMN_DATA_BINARY, new CoverOperation()),
|
||||
};
|
||||
|
||||
public Segment() {
|
||||
super(STRING_COLUMNS, LONG_COLUMNS, DOUBLE_COLUMNS, INTEGER_COLUMNS, BOOLEAN_COLUMNS, BYTE_COLUMNS);
|
||||
super(STRING_COLUMNS, LONG_COLUMNS, DOUBLE_COLUMNS, INTEGER_COLUMNS, BYTE_COLUMNS);
|
||||
}
|
||||
|
||||
@Override public String getId() {
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ import org.apache.skywalking.apm.collector.core.data.Column;
|
|||
import org.apache.skywalking.apm.collector.core.data.StreamData;
|
||||
import org.apache.skywalking.apm.collector.core.data.operator.CoverOperation;
|
||||
import org.apache.skywalking.apm.collector.core.data.operator.NonOperation;
|
||||
import org.apache.skywalking.apm.collector.core.util.BooleanUtils;
|
||||
|
||||
/**
|
||||
* @author peng-yongsheng
|
||||
|
|
@ -40,18 +41,18 @@ public class SegmentCost extends StreamData {
|
|||
new Column(SegmentCostTable.COLUMN_END_TIME, new CoverOperation()),
|
||||
new Column(SegmentCostTable.COLUMN_TIME_BUCKET, new CoverOperation()),
|
||||
};
|
||||
|
||||
private static final Column[] DOUBLE_COLUMNS = {};
|
||||
|
||||
private static final Column[] INTEGER_COLUMNS = {
|
||||
new Column(SegmentCostTable.COLUMN_APPLICATION_ID, new CoverOperation()),
|
||||
};
|
||||
|
||||
private static final Column[] BOOLEAN_COLUMNS = {
|
||||
new Column(SegmentCostTable.COLUMN_IS_ERROR, new CoverOperation()),
|
||||
};
|
||||
|
||||
private static final Column[] BYTE_COLUMNS = {};
|
||||
|
||||
public SegmentCost() {
|
||||
super(STRING_COLUMNS, LONG_COLUMNS, DOUBLE_COLUMNS, INTEGER_COLUMNS, BOOLEAN_COLUMNS, BYTE_COLUMNS);
|
||||
super(STRING_COLUMNS, LONG_COLUMNS, DOUBLE_COLUMNS, INTEGER_COLUMNS, BYTE_COLUMNS);
|
||||
}
|
||||
|
||||
@Override public String getId() {
|
||||
|
|
@ -127,10 +128,10 @@ public class SegmentCost extends StreamData {
|
|||
}
|
||||
|
||||
public Boolean getIsError() {
|
||||
return getDataBoolean(0);
|
||||
return BooleanUtils.valueToBoolean(getDataInteger(1));
|
||||
}
|
||||
|
||||
public void setIsError(Boolean isError) {
|
||||
setDataBoolean(0, isError);
|
||||
setDataInteger(0, BooleanUtils.booleanToValue(isError));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -60,12 +60,10 @@ public class ServiceMetric extends StreamData implements Metric {
|
|||
new Column(ServiceMetricTable.COLUMN_SERVICE_ID, new NonOperation()),
|
||||
};
|
||||
|
||||
private static final Column[] BOOLEAN_COLUMNS = {};
|
||||
|
||||
private static final Column[] BYTE_COLUMNS = {};
|
||||
|
||||
public ServiceMetric() {
|
||||
super(STRING_COLUMNS, LONG_COLUMNS, DOUBLE_COLUMNS, INTEGER_COLUMNS, BOOLEAN_COLUMNS, BYTE_COLUMNS);
|
||||
super(STRING_COLUMNS, LONG_COLUMNS, DOUBLE_COLUMNS, INTEGER_COLUMNS, BYTE_COLUMNS);
|
||||
}
|
||||
|
||||
@Override public String getId() {
|
||||
|
|
|
|||
|
|
@ -66,12 +66,10 @@ public class ServiceReferenceMetric extends StreamData implements Metric {
|
|||
new Column(ServiceReferenceMetricTable.COLUMN_BEHIND_APPLICATION_ID, new NonOperation()),
|
||||
};
|
||||
|
||||
private static final Column[] BOOLEAN_COLUMNS = {};
|
||||
|
||||
private static final Column[] BYTE_COLUMNS = {};
|
||||
|
||||
public ServiceReferenceMetric() {
|
||||
super(STRING_COLUMNS, LONG_COLUMNS, DOUBLE_COLUMNS, INTEGER_COLUMNS, BOOLEAN_COLUMNS, BYTE_COLUMNS);
|
||||
super(STRING_COLUMNS, LONG_COLUMNS, DOUBLE_COLUMNS, INTEGER_COLUMNS, BYTE_COLUMNS);
|
||||
}
|
||||
|
||||
@Override public String getId() {
|
||||
|
|
|
|||
|
|
@ -16,7 +16,6 @@
|
|||
*
|
||||
*/
|
||||
|
||||
|
||||
package org.apache.skywalking.apm.collector.storage.es.base.define;
|
||||
|
||||
import org.apache.skywalking.apm.collector.core.data.ColumnDefine;
|
||||
|
|
@ -30,6 +29,6 @@ public class ElasticSearchColumnDefine extends ColumnDefine {
|
|||
}
|
||||
|
||||
public enum Type {
|
||||
Binary, Boolean, Keyword, Long, Integer, Double, Text
|
||||
Binary, Keyword, Long, Integer, Double, Text
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@
|
|||
package org.apache.skywalking.apm.collector.storage.es.dao.cache;
|
||||
|
||||
import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient;
|
||||
import org.apache.skywalking.apm.collector.core.util.BooleanUtils;
|
||||
import org.apache.skywalking.apm.collector.core.util.Const;
|
||||
import org.apache.skywalking.apm.collector.storage.dao.cache.IApplicationCacheDAO;
|
||||
import org.apache.skywalking.apm.collector.storage.es.base.dao.EsDAO;
|
||||
|
|
@ -54,7 +55,7 @@ public class ApplicationEsCacheDAO extends EsDAO implements IApplicationCacheDAO
|
|||
|
||||
BoolQueryBuilder boolQueryBuilder = QueryBuilders.boolQuery();
|
||||
boolQueryBuilder.must().add(QueryBuilders.termQuery(ApplicationTable.COLUMN_APPLICATION_CODE, applicationCode));
|
||||
boolQueryBuilder.must().add(QueryBuilders.termQuery(ApplicationTable.COLUMN_IS_ADDRESS, false));
|
||||
boolQueryBuilder.must().add(QueryBuilders.termQuery(ApplicationTable.COLUMN_IS_ADDRESS, BooleanUtils.FALSE));
|
||||
|
||||
searchRequestBuilder.setQuery(boolQueryBuilder);
|
||||
searchRequestBuilder.setSize(1);
|
||||
|
|
@ -88,7 +89,7 @@ public class ApplicationEsCacheDAO extends EsDAO implements IApplicationCacheDAO
|
|||
|
||||
BoolQueryBuilder boolQueryBuilder = QueryBuilders.boolQuery();
|
||||
boolQueryBuilder.must().add(QueryBuilders.termQuery(ApplicationTable.COLUMN_ADDRESS_ID, addressId));
|
||||
boolQueryBuilder.must().add(QueryBuilders.termQuery(ApplicationTable.COLUMN_IS_ADDRESS, true));
|
||||
boolQueryBuilder.must().add(QueryBuilders.termQuery(ApplicationTable.COLUMN_IS_ADDRESS, BooleanUtils.TRUE));
|
||||
|
||||
searchRequestBuilder.setQuery(boolQueryBuilder);
|
||||
searchRequestBuilder.setSize(1);
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@
|
|||
package org.apache.skywalking.apm.collector.storage.es.dao.cache;
|
||||
|
||||
import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient;
|
||||
import org.apache.skywalking.apm.collector.core.util.BooleanUtils;
|
||||
import org.apache.skywalking.apm.collector.storage.dao.cache.IInstanceCacheDAO;
|
||||
import org.apache.skywalking.apm.collector.storage.es.base.dao.EsDAO;
|
||||
import org.apache.skywalking.apm.collector.storage.table.register.InstanceTable;
|
||||
|
|
@ -61,7 +62,7 @@ public class InstanceEsCacheDAO extends EsDAO implements IInstanceCacheDAO {
|
|||
BoolQueryBuilder builder = QueryBuilders.boolQuery();
|
||||
builder.must().add(QueryBuilders.termQuery(InstanceTable.COLUMN_APPLICATION_ID, applicationId));
|
||||
builder.must().add(QueryBuilders.termQuery(InstanceTable.COLUMN_AGENT_UUID, agentUUID));
|
||||
builder.must().add(QueryBuilders.termQuery(InstanceTable.COLUMN_IS_ADDRESS, false));
|
||||
builder.must().add(QueryBuilders.termQuery(InstanceTable.COLUMN_IS_ADDRESS, BooleanUtils.FALSE));
|
||||
searchRequestBuilder.setQuery(builder);
|
||||
searchRequestBuilder.setSize(1);
|
||||
|
||||
|
|
@ -82,7 +83,7 @@ public class InstanceEsCacheDAO extends EsDAO implements IInstanceCacheDAO {
|
|||
BoolQueryBuilder builder = QueryBuilders.boolQuery();
|
||||
builder.must().add(QueryBuilders.termQuery(InstanceTable.COLUMN_APPLICATION_ID, applicationId));
|
||||
builder.must().add(QueryBuilders.termQuery(InstanceTable.COLUMN_ADDRESS_ID, addressId));
|
||||
builder.must().add(QueryBuilders.termQuery(InstanceTable.COLUMN_IS_ADDRESS, true));
|
||||
builder.must().add(QueryBuilders.termQuery(InstanceTable.COLUMN_IS_ADDRESS, BooleanUtils.TRUE));
|
||||
searchRequestBuilder.setQuery(builder);
|
||||
searchRequestBuilder.setSize(1);
|
||||
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ public class SegmentCostEsTableDefine extends ElasticSearchTableDefine {
|
|||
addColumn(new ElasticSearchColumnDefine(SegmentCostTable.COLUMN_COST, ElasticSearchColumnDefine.Type.Long.name()));
|
||||
addColumn(new ElasticSearchColumnDefine(SegmentCostTable.COLUMN_START_TIME, ElasticSearchColumnDefine.Type.Long.name()));
|
||||
addColumn(new ElasticSearchColumnDefine(SegmentCostTable.COLUMN_END_TIME, ElasticSearchColumnDefine.Type.Long.name()));
|
||||
addColumn(new ElasticSearchColumnDefine(SegmentCostTable.COLUMN_IS_ERROR, ElasticSearchColumnDefine.Type.Boolean.name()));
|
||||
addColumn(new ElasticSearchColumnDefine(SegmentCostTable.COLUMN_IS_ERROR, ElasticSearchColumnDefine.Type.Integer.name()));
|
||||
addColumn(new ElasticSearchColumnDefine(SegmentCostTable.COLUMN_TIME_BUCKET, ElasticSearchColumnDefine.Type.Long.name()));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ public abstract class AbstractMemoryMetricEsTableDefine extends ElasticSearchTab
|
|||
addColumn(new ElasticSearchColumnDefine(MemoryMetricTable.COLUMN_ID, ElasticSearchColumnDefine.Type.Keyword.name()));
|
||||
addColumn(new ElasticSearchColumnDefine(MemoryMetricTable.COLUMN_METRIC_ID, ElasticSearchColumnDefine.Type.Keyword.name()));
|
||||
addColumn(new ElasticSearchColumnDefine(MemoryMetricTable.COLUMN_INSTANCE_ID, ElasticSearchColumnDefine.Type.Integer.name()));
|
||||
addColumn(new ElasticSearchColumnDefine(MemoryMetricTable.COLUMN_IS_HEAP, ElasticSearchColumnDefine.Type.Boolean.name()));
|
||||
addColumn(new ElasticSearchColumnDefine(MemoryMetricTable.COLUMN_IS_HEAP, ElasticSearchColumnDefine.Type.Integer.name()));
|
||||
addColumn(new ElasticSearchColumnDefine(MemoryMetricTable.COLUMN_INIT, ElasticSearchColumnDefine.Type.Long.name()));
|
||||
addColumn(new ElasticSearchColumnDefine(MemoryMetricTable.COLUMN_MAX, ElasticSearchColumnDefine.Type.Long.name()));
|
||||
addColumn(new ElasticSearchColumnDefine(MemoryMetricTable.COLUMN_USED, ElasticSearchColumnDefine.Type.Long.name()));
|
||||
|
|
|
|||
|
|
@ -39,6 +39,6 @@ public class ApplicationEsTableDefine extends ElasticSearchTableDefine {
|
|||
addColumn(new ElasticSearchColumnDefine(ApplicationTable.COLUMN_APPLICATION_CODE, ElasticSearchColumnDefine.Type.Keyword.name()));
|
||||
addColumn(new ElasticSearchColumnDefine(ApplicationTable.COLUMN_APPLICATION_ID, ElasticSearchColumnDefine.Type.Integer.name()));
|
||||
addColumn(new ElasticSearchColumnDefine(ApplicationTable.COLUMN_ADDRESS_ID, ElasticSearchColumnDefine.Type.Integer.name()));
|
||||
addColumn(new ElasticSearchColumnDefine(ApplicationTable.COLUMN_IS_ADDRESS, ElasticSearchColumnDefine.Type.Boolean.name()));
|
||||
addColumn(new ElasticSearchColumnDefine(ApplicationTable.COLUMN_IS_ADDRESS, ElasticSearchColumnDefine.Type.Integer.name()));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -43,6 +43,6 @@ public class InstanceEsTableDefine extends ElasticSearchTableDefine {
|
|||
addColumn(new ElasticSearchColumnDefine(InstanceTable.COLUMN_HEARTBEAT_TIME, ElasticSearchColumnDefine.Type.Long.name()));
|
||||
addColumn(new ElasticSearchColumnDefine(InstanceTable.COLUMN_OS_INFO, ElasticSearchColumnDefine.Type.Keyword.name()));
|
||||
addColumn(new ElasticSearchColumnDefine(InstanceTable.COLUMN_ADDRESS_ID, ElasticSearchColumnDefine.Type.Integer.name()));
|
||||
addColumn(new ElasticSearchColumnDefine(InstanceTable.COLUMN_IS_ADDRESS, ElasticSearchColumnDefine.Type.Boolean.name()));
|
||||
addColumn(new ElasticSearchColumnDefine(InstanceTable.COLUMN_IS_ADDRESS, ElasticSearchColumnDefine.Type.Integer.name()));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -40,6 +40,10 @@ import org.apache.skywalking.apm.collector.storage.dao.IMemoryPoolMetricUIDAO;
|
|||
import org.apache.skywalking.apm.collector.storage.dao.ISegmentCostUIDAO;
|
||||
import org.apache.skywalking.apm.collector.storage.dao.ISegmentUIDAO;
|
||||
import org.apache.skywalking.apm.collector.storage.dao.IServiceReferenceUIDAO;
|
||||
import org.apache.skywalking.apm.collector.storage.dao.acp.IApplicationComponentDayPersistenceDAO;
|
||||
import org.apache.skywalking.apm.collector.storage.dao.acp.IApplicationComponentHourPersistenceDAO;
|
||||
import org.apache.skywalking.apm.collector.storage.dao.acp.IApplicationComponentMinutePersistenceDAO;
|
||||
import org.apache.skywalking.apm.collector.storage.dao.acp.IApplicationComponentMonthPersistenceDAO;
|
||||
import org.apache.skywalking.apm.collector.storage.dao.cache.IApplicationCacheDAO;
|
||||
import org.apache.skywalking.apm.collector.storage.dao.cache.IInstanceCacheDAO;
|
||||
import org.apache.skywalking.apm.collector.storage.dao.cache.INetworkAddressCacheDAO;
|
||||
|
|
@ -71,22 +75,26 @@ import org.apache.skywalking.apm.collector.storage.dao.register.IServiceNameRegi
|
|||
import org.apache.skywalking.apm.collector.storage.h2.base.dao.BatchH2DAO;
|
||||
import org.apache.skywalking.apm.collector.storage.h2.base.define.H2StorageInstaller;
|
||||
import org.apache.skywalking.apm.collector.storage.h2.dao.ApplicationComponentH2UIDAO;
|
||||
import org.apache.skywalking.apm.collector.storage.h2.dao.ApplicationH2CacheDAO;
|
||||
import org.apache.skywalking.apm.collector.storage.h2.dao.ApplicationMappingH2UIDAO;
|
||||
import org.apache.skywalking.apm.collector.storage.h2.dao.ApplicationReferenceMetricH2UIDAO;
|
||||
import org.apache.skywalking.apm.collector.storage.h2.dao.CpuMetricH2UIDAO;
|
||||
import org.apache.skywalking.apm.collector.storage.h2.dao.GCMetricH2UIDAO;
|
||||
import org.apache.skywalking.apm.collector.storage.h2.dao.GlobalTraceH2UIDAO;
|
||||
import org.apache.skywalking.apm.collector.storage.h2.dao.InstanceH2CacheDAO;
|
||||
import org.apache.skywalking.apm.collector.storage.h2.dao.InstanceH2UIDAO;
|
||||
import org.apache.skywalking.apm.collector.storage.h2.dao.InstanceMetricH2UIDAO;
|
||||
import org.apache.skywalking.apm.collector.storage.h2.dao.MemoryMetricH2UIDAO;
|
||||
import org.apache.skywalking.apm.collector.storage.h2.dao.MemoryPoolMetricH2UIDAO;
|
||||
import org.apache.skywalking.apm.collector.storage.h2.dao.NetworkAddressH2CacheDAO;
|
||||
import org.apache.skywalking.apm.collector.storage.h2.dao.SegmentCostH2UIDAO;
|
||||
import org.apache.skywalking.apm.collector.storage.h2.dao.SegmentH2UIDAO;
|
||||
import org.apache.skywalking.apm.collector.storage.h2.dao.ServiceNameH2CacheDAO;
|
||||
import org.apache.skywalking.apm.collector.storage.h2.dao.ServiceReferenceH2UIDAO;
|
||||
import org.apache.skywalking.apm.collector.storage.h2.dao.acp.ApplicationComponentDayH2PersistenceDAO;
|
||||
import org.apache.skywalking.apm.collector.storage.h2.dao.acp.ApplicationComponentHourH2PersistenceDAO;
|
||||
import org.apache.skywalking.apm.collector.storage.h2.dao.acp.ApplicationComponentMinuteH2PersistenceDAO;
|
||||
import org.apache.skywalking.apm.collector.storage.h2.dao.acp.ApplicationComponentMonthH2PersistenceDAO;
|
||||
import org.apache.skywalking.apm.collector.storage.h2.dao.cache.ApplicationH2CacheDAO;
|
||||
import org.apache.skywalking.apm.collector.storage.h2.dao.cache.InstanceH2CacheDAO;
|
||||
import org.apache.skywalking.apm.collector.storage.h2.dao.cache.NetworkAddressH2CacheDAO;
|
||||
import org.apache.skywalking.apm.collector.storage.h2.dao.cache.ServiceNameH2CacheDAO;
|
||||
import org.apache.skywalking.apm.collector.storage.h2.dao.cpump.CpuDayMetricH2PersistenceDAO;
|
||||
import org.apache.skywalking.apm.collector.storage.h2.dao.cpump.CpuHourMetricH2PersistenceDAO;
|
||||
import org.apache.skywalking.apm.collector.storage.h2.dao.cpump.CpuMinuteMetricH2PersistenceDAO;
|
||||
|
|
@ -208,7 +216,12 @@ public class StorageModuleH2Provider extends ModuleProvider {
|
|||
this.registerServiceImplementation(IMemoryPoolMonthMetricPersistenceDAO.class, new MemoryPoolMonthMetricH2PersistenceDAO(h2Client));
|
||||
|
||||
// this.registerServiceImplementation(IGlobalTracePersistenceDAO.class, new GlobalTraceH2PersistenceDAO(h2Client));
|
||||
// this.registerServiceImplementation(IApplicationComponentMinutePersistenceDAO.class, new ApplicationComponentH2MinutePersistenceDAO(h2Client));
|
||||
|
||||
this.registerServiceImplementation(IApplicationComponentMinutePersistenceDAO.class, new ApplicationComponentMinuteH2PersistenceDAO(h2Client));
|
||||
this.registerServiceImplementation(IApplicationComponentHourPersistenceDAO.class, new ApplicationComponentHourH2PersistenceDAO(h2Client));
|
||||
this.registerServiceImplementation(IApplicationComponentDayPersistenceDAO.class, new ApplicationComponentDayH2PersistenceDAO(h2Client));
|
||||
this.registerServiceImplementation(IApplicationComponentMonthPersistenceDAO.class, new ApplicationComponentMonthH2PersistenceDAO(h2Client));
|
||||
|
||||
// this.registerServiceImplementation(IApplicationMappingMinutePersistenceDAO.class, new ApplicationMappingH2MinutePersistenceDAO(h2Client));
|
||||
// this.registerServiceImplementation(IApplicationMinuteMetricPersistenceDAO.class, new ApplicationMinuteMetricH2PersistenceDAO(h2Client));
|
||||
// this.registerServiceImplementation(IApplicationReferenceMinuteMetricPersistenceDAO.class, new ApplicationReferenceMinuteMetricH2PersistenceDAO(h2Client));
|
||||
|
|
|
|||
|
|
@ -16,7 +16,6 @@
|
|||
*
|
||||
*/
|
||||
|
||||
|
||||
package org.apache.skywalking.apm.collector.storage.h2.base.define;
|
||||
|
||||
import org.apache.skywalking.apm.collector.core.data.ColumnDefine;
|
||||
|
|
@ -31,6 +30,6 @@ public class H2ColumnDefine extends ColumnDefine {
|
|||
}
|
||||
|
||||
public enum Type {
|
||||
Boolean, Varchar, Int, Bigint, BINARY, Double
|
||||
Varchar, Int, Bigint, BINARY, Double
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,69 +0,0 @@
|
|||
/*
|
||||
* 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.apm.collector.storage.h2.dao;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import org.apache.skywalking.apm.collector.client.h2.H2Client;
|
||||
import org.apache.skywalking.apm.collector.storage.base.sql.SqlBuilder;
|
||||
import org.apache.skywalking.apm.collector.storage.dao.mpoolmp.IMemoryPoolSecondMetricPersistenceDAO;
|
||||
import org.apache.skywalking.apm.collector.storage.h2.base.dao.H2DAO;
|
||||
import org.apache.skywalking.apm.collector.storage.h2.base.define.H2SqlEntity;
|
||||
import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryPoolMetric;
|
||||
import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryPoolMetricTable;
|
||||
|
||||
/**
|
||||
* @author peng-yongsheng, clevertension
|
||||
*/
|
||||
public class MemoryPoolSecondMetricH2PersistenceDAO extends H2DAO implements IMemoryPoolSecondMetricPersistenceDAO<H2SqlEntity, H2SqlEntity, MemoryPoolMetric> {
|
||||
|
||||
public MemoryPoolSecondMetricH2PersistenceDAO(H2Client client) {
|
||||
super(client);
|
||||
}
|
||||
|
||||
@Override public MemoryPoolMetric get(String id) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override public H2SqlEntity prepareBatchInsert(MemoryPoolMetric data) {
|
||||
H2SqlEntity entity = new H2SqlEntity();
|
||||
Map<String, Object> source = new HashMap<>();
|
||||
source.put(MemoryPoolMetricTable.COLUMN_ID, data.getId());
|
||||
source.put(MemoryPoolMetricTable.COLUMN_INSTANCE_ID, data.getInstanceId());
|
||||
source.put(MemoryPoolMetricTable.COLUMN_POOL_TYPE, data.getPoolType());
|
||||
source.put(MemoryPoolMetricTable.COLUMN_INIT, data.getInit());
|
||||
source.put(MemoryPoolMetricTable.COLUMN_MAX, data.getMax());
|
||||
source.put(MemoryPoolMetricTable.COLUMN_USED, data.getUsed());
|
||||
source.put(MemoryPoolMetricTable.COLUMN_COMMITTED, data.getCommitted());
|
||||
source.put(MemoryPoolMetricTable.COLUMN_TIME_BUCKET, data.getTimeBucket());
|
||||
|
||||
String sql = SqlBuilder.buildBatchInsertSql(MemoryPoolMetricTable.TABLE, source.keySet());
|
||||
entity.setSql(sql);
|
||||
entity.setParams(source.values().toArray(new Object[0]));
|
||||
return entity;
|
||||
}
|
||||
|
||||
@Override public H2SqlEntity prepareBatchUpdate(MemoryPoolMetric data) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override public void deleteHistory(Long startTimestamp, Long endTimestamp) {
|
||||
}
|
||||
}
|
||||
|
|
@ -1,69 +0,0 @@
|
|||
/*
|
||||
* 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.apm.collector.storage.h2.dao;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import org.apache.skywalking.apm.collector.client.h2.H2Client;
|
||||
import org.apache.skywalking.apm.collector.storage.base.sql.SqlBuilder;
|
||||
import org.apache.skywalking.apm.collector.storage.dao.memorymp.IMemorySecondMetricPersistenceDAO;
|
||||
import org.apache.skywalking.apm.collector.storage.h2.base.dao.H2DAO;
|
||||
import org.apache.skywalking.apm.collector.storage.h2.base.define.H2SqlEntity;
|
||||
import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryMetric;
|
||||
import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryMetricTable;
|
||||
|
||||
/**
|
||||
* @author peng-yongsheng, clevertension
|
||||
*/
|
||||
public class MemorySecondMetricH2PersistenceDAO extends H2DAO implements IMemorySecondMetricPersistenceDAO<H2SqlEntity, H2SqlEntity, MemoryMetric> {
|
||||
|
||||
public MemorySecondMetricH2PersistenceDAO(H2Client client) {
|
||||
super(client);
|
||||
}
|
||||
|
||||
@Override public MemoryMetric get(String id) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override public H2SqlEntity prepareBatchInsert(MemoryMetric data) {
|
||||
H2SqlEntity entity = new H2SqlEntity();
|
||||
Map<String, Object> source = new HashMap<>();
|
||||
source.put(MemoryMetricTable.COLUMN_ID, data.getId());
|
||||
source.put(MemoryMetricTable.COLUMN_INSTANCE_ID, data.getInstanceId());
|
||||
source.put(MemoryMetricTable.COLUMN_IS_HEAP, data.getIsHeap());
|
||||
source.put(MemoryMetricTable.COLUMN_INIT, data.getInit());
|
||||
source.put(MemoryMetricTable.COLUMN_MAX, data.getMax());
|
||||
source.put(MemoryMetricTable.COLUMN_USED, data.getUsed());
|
||||
source.put(MemoryMetricTable.COLUMN_COMMITTED, data.getCommitted());
|
||||
source.put(MemoryMetricTable.COLUMN_TIME_BUCKET, data.getTimeBucket());
|
||||
|
||||
String sql = SqlBuilder.buildBatchInsertSql(MemoryMetricTable.TABLE, source.keySet());
|
||||
entity.setSql(sql);
|
||||
entity.setParams(source.values().toArray(new Object[0]));
|
||||
return entity;
|
||||
}
|
||||
|
||||
@Override public H2SqlEntity prepareBatchUpdate(MemoryMetric data) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override public void deleteHistory(Long startTimestamp, Long endTimestamp) {
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,60 @@
|
|||
/*
|
||||
* 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.apm.collector.storage.h2.dao.acp;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import org.apache.skywalking.apm.collector.client.h2.H2Client;
|
||||
import org.apache.skywalking.apm.collector.storage.h2.base.dao.AbstractPersistenceH2DAO;
|
||||
import org.apache.skywalking.apm.collector.storage.table.application.ApplicationComponent;
|
||||
import org.apache.skywalking.apm.collector.storage.table.application.ApplicationComponentTable;
|
||||
|
||||
/**
|
||||
* @author peng-yongsheng
|
||||
*/
|
||||
public abstract class AbstractApplicationComponentH2PersistenceDAO extends AbstractPersistenceH2DAO<ApplicationComponent> {
|
||||
|
||||
AbstractApplicationComponentH2PersistenceDAO(H2Client client) {
|
||||
super(client);
|
||||
}
|
||||
|
||||
@Override protected final ApplicationComponent h2DataToStreamData(ResultSet resultSet) throws SQLException {
|
||||
ApplicationComponent applicationComponent = new ApplicationComponent();
|
||||
applicationComponent.setId(resultSet.getString(ApplicationComponentTable.COLUMN_ID));
|
||||
applicationComponent.setMetricId(resultSet.getString(ApplicationComponentTable.COLUMN_METRIC_ID));
|
||||
|
||||
applicationComponent.setComponentId(resultSet.getInt(ApplicationComponentTable.COLUMN_COMPONENT_ID));
|
||||
applicationComponent.setPeerId(resultSet.getInt(ApplicationComponentTable.COLUMN_PEER_ID));
|
||||
applicationComponent.setTimeBucket(resultSet.getLong(ApplicationComponentTable.COLUMN_TIME_BUCKET));
|
||||
return applicationComponent;
|
||||
}
|
||||
|
||||
@Override protected final Map<String, Object> streamDataToH2Data(ApplicationComponent streamData) {
|
||||
Map<String, Object> source = new HashMap<>();
|
||||
source.put(ApplicationComponentTable.COLUMN_METRIC_ID, streamData.getMetricId());
|
||||
|
||||
source.put(ApplicationComponentTable.COLUMN_COMPONENT_ID, streamData.getComponentId());
|
||||
source.put(ApplicationComponentTable.COLUMN_PEER_ID, streamData.getPeerId());
|
||||
source.put(ApplicationComponentTable.COLUMN_TIME_BUCKET, streamData.getTimeBucket());
|
||||
|
||||
return source;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
/*
|
||||
* 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.apm.collector.storage.h2.dao.acp;
|
||||
|
||||
import org.apache.skywalking.apm.collector.client.h2.H2Client;
|
||||
import org.apache.skywalking.apm.collector.core.storage.TimePyramid;
|
||||
import org.apache.skywalking.apm.collector.core.util.Const;
|
||||
import org.apache.skywalking.apm.collector.storage.dao.acp.IApplicationComponentDayPersistenceDAO;
|
||||
import org.apache.skywalking.apm.collector.storage.h2.base.define.H2SqlEntity;
|
||||
import org.apache.skywalking.apm.collector.storage.table.application.ApplicationComponent;
|
||||
import org.apache.skywalking.apm.collector.storage.table.application.ApplicationComponentTable;
|
||||
|
||||
/**
|
||||
* @author peng-yongsheng, clevertension
|
||||
*/
|
||||
public class ApplicationComponentDayH2PersistenceDAO extends AbstractApplicationComponentH2PersistenceDAO implements IApplicationComponentDayPersistenceDAO<H2SqlEntity, H2SqlEntity, ApplicationComponent> {
|
||||
|
||||
public ApplicationComponentDayH2PersistenceDAO(H2Client client) {
|
||||
super(client);
|
||||
}
|
||||
|
||||
@Override protected String tableName() {
|
||||
return ApplicationComponentTable.TABLE + Const.ID_SPLIT + TimePyramid.Day.getName();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
/*
|
||||
* 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.apm.collector.storage.h2.dao.acp;
|
||||
|
||||
import org.apache.skywalking.apm.collector.client.h2.H2Client;
|
||||
import org.apache.skywalking.apm.collector.core.storage.TimePyramid;
|
||||
import org.apache.skywalking.apm.collector.core.util.Const;
|
||||
import org.apache.skywalking.apm.collector.storage.dao.acp.IApplicationComponentHourPersistenceDAO;
|
||||
import org.apache.skywalking.apm.collector.storage.h2.base.define.H2SqlEntity;
|
||||
import org.apache.skywalking.apm.collector.storage.table.application.ApplicationComponent;
|
||||
import org.apache.skywalking.apm.collector.storage.table.application.ApplicationComponentTable;
|
||||
|
||||
/**
|
||||
* @author peng-yongsheng, clevertension
|
||||
*/
|
||||
public class ApplicationComponentHourH2PersistenceDAO extends AbstractApplicationComponentH2PersistenceDAO implements IApplicationComponentHourPersistenceDAO<H2SqlEntity, H2SqlEntity, ApplicationComponent> {
|
||||
|
||||
public ApplicationComponentHourH2PersistenceDAO(H2Client client) {
|
||||
super(client);
|
||||
}
|
||||
|
||||
@Override protected String tableName() {
|
||||
return ApplicationComponentTable.TABLE + Const.ID_SPLIT + TimePyramid.Hour.getName();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
/*
|
||||
* 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.apm.collector.storage.h2.dao.acp;
|
||||
|
||||
import org.apache.skywalking.apm.collector.client.h2.H2Client;
|
||||
import org.apache.skywalking.apm.collector.core.storage.TimePyramid;
|
||||
import org.apache.skywalking.apm.collector.core.util.Const;
|
||||
import org.apache.skywalking.apm.collector.storage.dao.acp.IApplicationComponentMinutePersistenceDAO;
|
||||
import org.apache.skywalking.apm.collector.storage.h2.base.define.H2SqlEntity;
|
||||
import org.apache.skywalking.apm.collector.storage.table.application.ApplicationComponent;
|
||||
import org.apache.skywalking.apm.collector.storage.table.application.ApplicationComponentTable;
|
||||
|
||||
/**
|
||||
* @author peng-yongsheng, clevertension
|
||||
*/
|
||||
public class ApplicationComponentMinuteH2PersistenceDAO extends AbstractApplicationComponentH2PersistenceDAO implements IApplicationComponentMinutePersistenceDAO<H2SqlEntity, H2SqlEntity, ApplicationComponent> {
|
||||
|
||||
public ApplicationComponentMinuteH2PersistenceDAO(H2Client client) {
|
||||
super(client);
|
||||
}
|
||||
|
||||
@Override protected String tableName() {
|
||||
return ApplicationComponentTable.TABLE + Const.ID_SPLIT + TimePyramid.Minute.getName();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
/*
|
||||
* 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.apm.collector.storage.h2.dao.acp;
|
||||
|
||||
import org.apache.skywalking.apm.collector.client.h2.H2Client;
|
||||
import org.apache.skywalking.apm.collector.core.storage.TimePyramid;
|
||||
import org.apache.skywalking.apm.collector.core.util.Const;
|
||||
import org.apache.skywalking.apm.collector.storage.dao.acp.IApplicationComponentMonthPersistenceDAO;
|
||||
import org.apache.skywalking.apm.collector.storage.h2.base.define.H2SqlEntity;
|
||||
import org.apache.skywalking.apm.collector.storage.table.application.ApplicationComponent;
|
||||
import org.apache.skywalking.apm.collector.storage.table.application.ApplicationComponentTable;
|
||||
|
||||
/**
|
||||
* @author peng-yongsheng, clevertension
|
||||
*/
|
||||
public class ApplicationComponentMonthH2PersistenceDAO extends AbstractApplicationComponentH2PersistenceDAO implements IApplicationComponentMonthPersistenceDAO<H2SqlEntity, H2SqlEntity, ApplicationComponent> {
|
||||
|
||||
public ApplicationComponentMonthH2PersistenceDAO(H2Client client) {
|
||||
super(client);
|
||||
}
|
||||
|
||||
@Override protected String tableName() {
|
||||
return ApplicationComponentTable.TABLE + Const.ID_SPLIT + TimePyramid.Month.getName();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,94 @@
|
|||
/*
|
||||
* 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.apm.collector.storage.h2.dao.cache;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import org.apache.skywalking.apm.collector.client.h2.H2Client;
|
||||
import org.apache.skywalking.apm.collector.client.h2.H2ClientException;
|
||||
import org.apache.skywalking.apm.collector.core.util.Const;
|
||||
import org.apache.skywalking.apm.collector.storage.base.sql.SqlBuilder;
|
||||
import org.apache.skywalking.apm.collector.storage.dao.cache.IApplicationCacheDAO;
|
||||
import org.apache.skywalking.apm.collector.storage.h2.base.dao.H2DAO;
|
||||
import org.apache.skywalking.apm.collector.storage.table.register.ApplicationTable;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* @author peng-yongsheng, clevertension
|
||||
*/
|
||||
public class ApplicationH2CacheDAO extends H2DAO implements IApplicationCacheDAO {
|
||||
|
||||
private final Logger logger = LoggerFactory.getLogger(ApplicationH2CacheDAO.class);
|
||||
|
||||
private static final String GET_APPLICATION_ID_SQL = "select {0} from {1} where {2} = ? and {3} = ?";
|
||||
private static final String GET_APPLICATION_CODE_SQL = "select {0} from {1} where {2} = ?";
|
||||
|
||||
public ApplicationH2CacheDAO(H2Client client) {
|
||||
super(client);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getApplicationIdByCode(String applicationCode) {
|
||||
logger.info("get the application id with application code = {}", applicationCode);
|
||||
H2Client client = getClient();
|
||||
String sql = SqlBuilder.buildSql(GET_APPLICATION_ID_SQL, ApplicationTable.COLUMN_APPLICATION_ID, ApplicationTable.TABLE, ApplicationTable.COLUMN_APPLICATION_CODE, ApplicationTable.COLUMN_IS_ADDRESS);
|
||||
|
||||
Object[] params = new Object[] {applicationCode, false};
|
||||
try (ResultSet rs = client.executeQuery(sql, params)) {
|
||||
if (rs.next()) {
|
||||
return rs.getInt(1);
|
||||
}
|
||||
} catch (SQLException | H2ClientException e) {
|
||||
logger.error(e.getMessage(), e);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override public String getApplicationCode(int applicationId) {
|
||||
logger.debug("get application code, applicationId: {}", applicationId);
|
||||
H2Client client = getClient();
|
||||
String sql = SqlBuilder.buildSql(GET_APPLICATION_CODE_SQL, ApplicationTable.COLUMN_APPLICATION_CODE, ApplicationTable.TABLE, ApplicationTable.COLUMN_APPLICATION_ID);
|
||||
Object[] params = new Object[] {applicationId};
|
||||
try (ResultSet rs = client.executeQuery(sql, params)) {
|
||||
if (rs.next()) {
|
||||
return rs.getString(1);
|
||||
}
|
||||
} catch (SQLException | H2ClientException e) {
|
||||
logger.error(e.getMessage(), e);
|
||||
}
|
||||
return Const.EMPTY_STRING;
|
||||
}
|
||||
|
||||
@Override public int getApplicationIdByAddressId(int addressId) {
|
||||
logger.info("get the application id with address id = {}", addressId);
|
||||
H2Client client = getClient();
|
||||
String sql = SqlBuilder.buildSql(GET_APPLICATION_ID_SQL, ApplicationTable.COLUMN_APPLICATION_ID, ApplicationTable.TABLE, ApplicationTable.COLUMN_ADDRESS_ID, ApplicationTable.COLUMN_IS_ADDRESS);
|
||||
|
||||
Object[] params = new Object[] {addressId, true};
|
||||
try (ResultSet rs = client.executeQuery(sql, params)) {
|
||||
if (rs.next()) {
|
||||
return rs.getInt(1);
|
||||
}
|
||||
} catch (SQLException | H2ClientException e) {
|
||||
logger.error(e.getMessage(), e);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,93 @@
|
|||
/*
|
||||
* 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.apm.collector.storage.h2.dao.cache;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import org.apache.skywalking.apm.collector.client.h2.H2Client;
|
||||
import org.apache.skywalking.apm.collector.client.h2.H2ClientException;
|
||||
import org.apache.skywalking.apm.collector.core.util.BooleanUtils;
|
||||
import org.apache.skywalking.apm.collector.storage.base.sql.SqlBuilder;
|
||||
import org.apache.skywalking.apm.collector.storage.dao.cache.IInstanceCacheDAO;
|
||||
import org.apache.skywalking.apm.collector.storage.h2.base.dao.H2DAO;
|
||||
import org.apache.skywalking.apm.collector.storage.table.register.InstanceTable;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* @author peng-yongsheng
|
||||
*/
|
||||
public class InstanceH2CacheDAO extends H2DAO implements IInstanceCacheDAO {
|
||||
|
||||
private final Logger logger = LoggerFactory.getLogger(InstanceH2CacheDAO.class);
|
||||
|
||||
private static final String GET_APPLICATION_ID_SQL = "select {0} from {1} where {2} = ?";
|
||||
private static final String GET_INSTANCE_ID_SQL = "select {0} from {1} where {2} = ? and {3} = ? and {4} = ?";
|
||||
|
||||
public InstanceH2CacheDAO(H2Client client) {
|
||||
super(client);
|
||||
}
|
||||
|
||||
@Override public int getApplicationId(int instanceId) {
|
||||
logger.info("get the application id by instance id = {}", instanceId);
|
||||
H2Client client = getClient();
|
||||
String sql = SqlBuilder.buildSql(GET_APPLICATION_ID_SQL, InstanceTable.COLUMN_APPLICATION_ID, InstanceTable.TABLE, InstanceTable.COLUMN_INSTANCE_ID);
|
||||
Object[] params = new Object[] {instanceId};
|
||||
try (ResultSet rs = client.executeQuery(sql, params)) {
|
||||
if (rs.next()) {
|
||||
return rs.getInt(InstanceTable.COLUMN_APPLICATION_ID);
|
||||
}
|
||||
} catch (SQLException | H2ClientException e) {
|
||||
logger.error(e.getMessage(), e);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override public int getInstanceIdByAgentUUID(int applicationId, String agentUUID) {
|
||||
logger.info("get the instance id by application id = {}, agentUUID = {}", applicationId, agentUUID);
|
||||
H2Client client = getClient();
|
||||
String sql = SqlBuilder.buildSql(GET_INSTANCE_ID_SQL, InstanceTable.COLUMN_INSTANCE_ID, InstanceTable.TABLE, InstanceTable.COLUMN_APPLICATION_ID,
|
||||
InstanceTable.COLUMN_AGENT_UUID, InstanceTable.COLUMN_IS_ADDRESS);
|
||||
Object[] params = new Object[] {applicationId, agentUUID, BooleanUtils.FALSE};
|
||||
try (ResultSet rs = client.executeQuery(sql, params)) {
|
||||
if (rs.next()) {
|
||||
return rs.getInt(InstanceTable.COLUMN_INSTANCE_ID);
|
||||
}
|
||||
} catch (SQLException | H2ClientException e) {
|
||||
logger.error(e.getMessage(), e);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override public int getInstanceIdByAddressId(int applicationId, int addressId) {
|
||||
logger.info("get the instance id by application id = {}, address id = {}", applicationId, addressId);
|
||||
H2Client client = getClient();
|
||||
String sql = SqlBuilder.buildSql(GET_INSTANCE_ID_SQL, InstanceTable.COLUMN_INSTANCE_ID, InstanceTable.TABLE, InstanceTable.COLUMN_APPLICATION_ID,
|
||||
InstanceTable.COLUMN_ADDRESS_ID, InstanceTable.COLUMN_IS_ADDRESS);
|
||||
Object[] params = new Object[] {applicationId, addressId, BooleanUtils.TRUE};
|
||||
try (ResultSet rs = client.executeQuery(sql, params)) {
|
||||
if (rs.next()) {
|
||||
return rs.getInt(InstanceTable.COLUMN_INSTANCE_ID);
|
||||
}
|
||||
} catch (SQLException | H2ClientException e) {
|
||||
logger.error(e.getMessage(), e);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,77 @@
|
|||
/*
|
||||
* 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.apm.collector.storage.h2.dao.cache;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import org.apache.skywalking.apm.collector.client.h2.H2Client;
|
||||
import org.apache.skywalking.apm.collector.client.h2.H2ClientException;
|
||||
import org.apache.skywalking.apm.collector.core.util.Const;
|
||||
import org.apache.skywalking.apm.collector.storage.base.sql.SqlBuilder;
|
||||
import org.apache.skywalking.apm.collector.storage.dao.cache.INetworkAddressCacheDAO;
|
||||
import org.apache.skywalking.apm.collector.storage.h2.base.dao.H2DAO;
|
||||
import org.apache.skywalking.apm.collector.storage.table.register.NetworkAddressTable;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* @author peng-yongsheng, clevertension
|
||||
*/
|
||||
public class NetworkAddressH2CacheDAO extends H2DAO implements INetworkAddressCacheDAO {
|
||||
|
||||
private final Logger logger = LoggerFactory.getLogger(NetworkAddressH2CacheDAO.class);
|
||||
|
||||
private static final String GET_ADDRESS_ID_OR_CODE_SQL = "select {0} from {1} where {2} = ?";
|
||||
|
||||
public NetworkAddressH2CacheDAO(H2Client client) {
|
||||
super(client);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getAddressId(String networkAddress) {
|
||||
logger.info("get the address id with network address = {}", networkAddress);
|
||||
H2Client client = getClient();
|
||||
String sql = SqlBuilder.buildSql(GET_ADDRESS_ID_OR_CODE_SQL, NetworkAddressTable.COLUMN_ADDRESS_ID, NetworkAddressTable.TABLE, NetworkAddressTable.COLUMN_NETWORK_ADDRESS);
|
||||
|
||||
Object[] params = new Object[] {networkAddress};
|
||||
try (ResultSet rs = client.executeQuery(sql, params)) {
|
||||
if (rs.next()) {
|
||||
return rs.getInt(1);
|
||||
}
|
||||
} catch (SQLException | H2ClientException e) {
|
||||
logger.error(e.getMessage(), e);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override public String getAddress(int addressId) {
|
||||
logger.debug("get network address, address id: {}", addressId);
|
||||
H2Client client = getClient();
|
||||
String sql = SqlBuilder.buildSql(GET_ADDRESS_ID_OR_CODE_SQL, NetworkAddressTable.COLUMN_NETWORK_ADDRESS, NetworkAddressTable.TABLE, NetworkAddressTable.COLUMN_ADDRESS_ID);
|
||||
Object[] params = new Object[] {addressId};
|
||||
try (ResultSet rs = client.executeQuery(sql, params)) {
|
||||
if (rs.next()) {
|
||||
return rs.getString(1);
|
||||
}
|
||||
} catch (SQLException | H2ClientException e) {
|
||||
logger.error(e.getMessage(), e);
|
||||
}
|
||||
return Const.EMPTY_STRING;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,79 @@
|
|||
/*
|
||||
* 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.apm.collector.storage.h2.dao.cache;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import org.apache.skywalking.apm.collector.core.util.Const;
|
||||
import org.apache.skywalking.apm.collector.storage.base.sql.SqlBuilder;
|
||||
import org.apache.skywalking.apm.collector.client.h2.H2Client;
|
||||
import org.apache.skywalking.apm.collector.client.h2.H2ClientException;
|
||||
import org.apache.skywalking.apm.collector.storage.dao.cache.IServiceNameCacheDAO;
|
||||
import org.apache.skywalking.apm.collector.storage.h2.base.dao.H2DAO;
|
||||
import org.apache.skywalking.apm.collector.storage.table.register.ServiceNameTable;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* @author peng-yongsheng, clevertension
|
||||
*/
|
||||
public class ServiceNameH2CacheDAO extends H2DAO implements IServiceNameCacheDAO {
|
||||
|
||||
private final Logger logger = LoggerFactory.getLogger(ServiceNameH2CacheDAO.class);
|
||||
|
||||
private static final String GET_SERVICE_NAME_SQL = "select {0},{1} from {2} where {3} = ?";
|
||||
private static final String GET_SERVICE_ID_SQL = "select {0} from {1} where {2} = ? and {3} = ? limit 1";
|
||||
|
||||
public ServiceNameH2CacheDAO(H2Client client) {
|
||||
super(client);
|
||||
}
|
||||
|
||||
@Override public String getServiceName(int serviceId) {
|
||||
H2Client client = getClient();
|
||||
String sql = SqlBuilder.buildSql(GET_SERVICE_NAME_SQL, ServiceNameTable.COLUMN_APPLICATION_ID, ServiceNameTable.COLUMN_SERVICE_NAME,
|
||||
ServiceNameTable.TABLE, ServiceNameTable.COLUMN_SERVICE_ID);
|
||||
Object[] params = new Object[] {serviceId};
|
||||
try (ResultSet rs = client.executeQuery(sql, params)) {
|
||||
if (rs.next()) {
|
||||
String serviceName = rs.getString(ServiceNameTable.COLUMN_SERVICE_NAME);
|
||||
int applicationId = rs.getInt(ServiceNameTable.COLUMN_APPLICATION_ID);
|
||||
return applicationId + Const.ID_SPLIT + serviceName;
|
||||
}
|
||||
} catch (SQLException | H2ClientException e) {
|
||||
logger.error(e.getMessage(), e);
|
||||
}
|
||||
return Const.EMPTY_STRING;
|
||||
}
|
||||
|
||||
@Override public int getServiceId(int applicationId, String serviceName) {
|
||||
H2Client client = getClient();
|
||||
String sql = SqlBuilder.buildSql(GET_SERVICE_ID_SQL, ServiceNameTable.COLUMN_SERVICE_ID,
|
||||
ServiceNameTable.TABLE, ServiceNameTable.COLUMN_APPLICATION_ID, ServiceNameTable.COLUMN_SERVICE_NAME);
|
||||
Object[] params = new Object[] {applicationId, serviceName};
|
||||
try (ResultSet rs = client.executeQuery(sql, params)) {
|
||||
if (rs.next()) {
|
||||
return rs.getInt(ServiceNameTable.COLUMN_SERVICE_ID);
|
||||
}
|
||||
} catch (SQLException | H2ClientException e) {
|
||||
logger.error(e.getMessage(), e);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,45 +0,0 @@
|
|||
/*
|
||||
* 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.apm.collector.storage.h2.define;
|
||||
|
||||
import org.apache.skywalking.apm.collector.storage.h2.base.define.H2TableDefine;
|
||||
import org.apache.skywalking.apm.collector.storage.h2.base.define.H2ColumnDefine;
|
||||
import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryPoolMetricTable;
|
||||
|
||||
/**
|
||||
* @author peng-yongsheng
|
||||
*/
|
||||
public class MemoryPoolMetricH2TableDefine extends H2TableDefine {
|
||||
|
||||
public MemoryPoolMetricH2TableDefine() {
|
||||
super(MemoryPoolMetricTable.TABLE);
|
||||
}
|
||||
|
||||
@Override public void initialize() {
|
||||
addColumn(new H2ColumnDefine(MemoryPoolMetricTable.COLUMN_ID, H2ColumnDefine.Type.Varchar.name()));
|
||||
addColumn(new H2ColumnDefine(MemoryPoolMetricTable.COLUMN_INSTANCE_ID, H2ColumnDefine.Type.Int.name()));
|
||||
addColumn(new H2ColumnDefine(MemoryPoolMetricTable.COLUMN_POOL_TYPE, H2ColumnDefine.Type.Int.name()));
|
||||
addColumn(new H2ColumnDefine(MemoryPoolMetricTable.COLUMN_INIT, H2ColumnDefine.Type.Bigint.name()));
|
||||
addColumn(new H2ColumnDefine(MemoryPoolMetricTable.COLUMN_MAX, H2ColumnDefine.Type.Bigint.name()));
|
||||
addColumn(new H2ColumnDefine(MemoryPoolMetricTable.COLUMN_USED, H2ColumnDefine.Type.Bigint.name()));
|
||||
addColumn(new H2ColumnDefine(MemoryPoolMetricTable.COLUMN_COMMITTED, H2ColumnDefine.Type.Bigint.name()));
|
||||
addColumn(new H2ColumnDefine(MemoryPoolMetricTable.COLUMN_TIME_BUCKET, H2ColumnDefine.Type.Bigint.name()));
|
||||
}
|
||||
}
|
||||
|
|
@ -16,11 +16,10 @@
|
|||
*
|
||||
*/
|
||||
|
||||
|
||||
package org.apache.skywalking.apm.collector.storage.h2.define;
|
||||
|
||||
import org.apache.skywalking.apm.collector.storage.h2.base.define.H2TableDefine;
|
||||
import org.apache.skywalking.apm.collector.storage.h2.base.define.H2ColumnDefine;
|
||||
import org.apache.skywalking.apm.collector.storage.h2.base.define.H2TableDefine;
|
||||
import org.apache.skywalking.apm.collector.storage.table.segment.SegmentCostTable;
|
||||
|
||||
/**
|
||||
|
|
@ -40,7 +39,7 @@ public class SegmentCostH2TableDefine extends H2TableDefine {
|
|||
addColumn(new H2ColumnDefine(SegmentCostTable.COLUMN_COST, H2ColumnDefine.Type.Bigint.name()));
|
||||
addColumn(new H2ColumnDefine(SegmentCostTable.COLUMN_START_TIME, H2ColumnDefine.Type.Bigint.name()));
|
||||
addColumn(new H2ColumnDefine(SegmentCostTable.COLUMN_END_TIME, H2ColumnDefine.Type.Bigint.name()));
|
||||
addColumn(new H2ColumnDefine(SegmentCostTable.COLUMN_IS_ERROR, H2ColumnDefine.Type.Boolean.name()));
|
||||
addColumn(new H2ColumnDefine(SegmentCostTable.COLUMN_IS_ERROR, H2ColumnDefine.Type.Int.name()));
|
||||
addColumn(new H2ColumnDefine(SegmentCostTable.COLUMN_TIME_BUCKET, H2ColumnDefine.Type.Bigint.name()));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,41 @@
|
|||
/*
|
||||
* 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.apm.collector.storage.h2.define.appcomp;
|
||||
|
||||
import org.apache.skywalking.apm.collector.storage.h2.base.define.H2ColumnDefine;
|
||||
import org.apache.skywalking.apm.collector.storage.h2.base.define.H2TableDefine;
|
||||
import org.apache.skywalking.apm.collector.storage.table.application.ApplicationComponentTable;
|
||||
|
||||
/**
|
||||
* @author peng-yongsheng
|
||||
*/
|
||||
public abstract class AbstractApplicationComponentH2TableDefine extends H2TableDefine {
|
||||
|
||||
AbstractApplicationComponentH2TableDefine(String name) {
|
||||
super(name);
|
||||
}
|
||||
|
||||
@Override public final void initialize() {
|
||||
addColumn(new H2ColumnDefine(ApplicationComponentTable.COLUMN_ID, H2ColumnDefine.Type.Varchar.name()));
|
||||
addColumn(new H2ColumnDefine(ApplicationComponentTable.COLUMN_METRIC_ID, H2ColumnDefine.Type.Varchar.name()));
|
||||
addColumn(new H2ColumnDefine(ApplicationComponentTable.COLUMN_COMPONENT_ID, H2ColumnDefine.Type.Int.name()));
|
||||
addColumn(new H2ColumnDefine(ApplicationComponentTable.COLUMN_PEER_ID, H2ColumnDefine.Type.Int.name()));
|
||||
addColumn(new H2ColumnDefine(ApplicationComponentTable.COLUMN_TIME_BUCKET, H2ColumnDefine.Type.Bigint.name()));
|
||||
}
|
||||
}
|
||||
|
|
@ -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.apm.collector.storage.h2.define.appcomp;
|
||||
|
||||
import org.apache.skywalking.apm.collector.core.storage.TimePyramid;
|
||||
import org.apache.skywalking.apm.collector.core.util.Const;
|
||||
import org.apache.skywalking.apm.collector.storage.table.application.ApplicationComponentTable;
|
||||
|
||||
/**
|
||||
* @author peng-yongsheng
|
||||
*/
|
||||
public class ApplicationComponentDayH2TableDefine extends AbstractApplicationComponentH2TableDefine {
|
||||
|
||||
public ApplicationComponentDayH2TableDefine() {
|
||||
super(ApplicationComponentTable.TABLE + Const.ID_SPLIT + TimePyramid.Day.getName());
|
||||
}
|
||||
}
|
||||
|
|
@ -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.apm.collector.storage.h2.define.appcomp;
|
||||
|
||||
import org.apache.skywalking.apm.collector.core.storage.TimePyramid;
|
||||
import org.apache.skywalking.apm.collector.core.util.Const;
|
||||
import org.apache.skywalking.apm.collector.storage.table.application.ApplicationComponentTable;
|
||||
|
||||
/**
|
||||
* @author peng-yongsheng
|
||||
*/
|
||||
public class ApplicationComponentHourH2TableDefine extends AbstractApplicationComponentH2TableDefine {
|
||||
|
||||
public ApplicationComponentHourH2TableDefine() {
|
||||
super(ApplicationComponentTable.TABLE + Const.ID_SPLIT + TimePyramid.Hour.getName());
|
||||
}
|
||||
}
|
||||
|
|
@ -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.apm.collector.storage.h2.define.appcomp;
|
||||
|
||||
import org.apache.skywalking.apm.collector.core.storage.TimePyramid;
|
||||
import org.apache.skywalking.apm.collector.core.util.Const;
|
||||
import org.apache.skywalking.apm.collector.storage.table.application.ApplicationComponentTable;
|
||||
|
||||
/**
|
||||
* @author peng-yongsheng
|
||||
*/
|
||||
public class ApplicationComponentMinuteH2TableDefine extends AbstractApplicationComponentH2TableDefine {
|
||||
|
||||
public ApplicationComponentMinuteH2TableDefine() {
|
||||
super(ApplicationComponentTable.TABLE + Const.ID_SPLIT + TimePyramid.Minute.getName());
|
||||
}
|
||||
}
|
||||
|
|
@ -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.apm.collector.storage.h2.define.appcomp;
|
||||
|
||||
import org.apache.skywalking.apm.collector.core.storage.TimePyramid;
|
||||
import org.apache.skywalking.apm.collector.core.util.Const;
|
||||
import org.apache.skywalking.apm.collector.storage.table.application.ApplicationComponentTable;
|
||||
|
||||
/**
|
||||
* @author peng-yongsheng
|
||||
*/
|
||||
public class ApplicationComponentMonthH2TableDefine extends AbstractApplicationComponentH2TableDefine {
|
||||
|
||||
public ApplicationComponentMonthH2TableDefine() {
|
||||
super(ApplicationComponentTable.TABLE + Const.ID_SPLIT + TimePyramid.Month.getName());
|
||||
}
|
||||
}
|
||||
|
|
@ -35,7 +35,7 @@ public abstract class AbstractMemoryMetricH2TableDefine extends H2TableDefine {
|
|||
addColumn(new H2ColumnDefine(MemoryMetricTable.COLUMN_ID, H2ColumnDefine.Type.Varchar.name()));
|
||||
addColumn(new H2ColumnDefine(MemoryMetricTable.COLUMN_METRIC_ID, H2ColumnDefine.Type.Varchar.name()));
|
||||
addColumn(new H2ColumnDefine(MemoryMetricTable.COLUMN_INSTANCE_ID, H2ColumnDefine.Type.Int.name()));
|
||||
addColumn(new H2ColumnDefine(MemoryMetricTable.COLUMN_IS_HEAP, H2ColumnDefine.Type.Boolean.name()));
|
||||
addColumn(new H2ColumnDefine(MemoryMetricTable.COLUMN_IS_HEAP, H2ColumnDefine.Type.Int.name()));
|
||||
addColumn(new H2ColumnDefine(MemoryMetricTable.COLUMN_INIT, H2ColumnDefine.Type.Bigint.name()));
|
||||
addColumn(new H2ColumnDefine(MemoryMetricTable.COLUMN_MAX, H2ColumnDefine.Type.Bigint.name()));
|
||||
addColumn(new H2ColumnDefine(MemoryMetricTable.COLUMN_USED, H2ColumnDefine.Type.Bigint.name()));
|
||||
|
|
|
|||
|
|
@ -36,6 +36,6 @@ public class ApplicationH2TableDefine extends H2TableDefine {
|
|||
addColumn(new H2ColumnDefine(ApplicationTable.COLUMN_APPLICATION_CODE, H2ColumnDefine.Type.Varchar.name()));
|
||||
addColumn(new H2ColumnDefine(ApplicationTable.COLUMN_APPLICATION_ID, H2ColumnDefine.Type.Int.name()));
|
||||
addColumn(new H2ColumnDefine(ApplicationTable.COLUMN_ADDRESS_ID, H2ColumnDefine.Type.Int.name()));
|
||||
addColumn(new H2ColumnDefine(ApplicationTable.COLUMN_IS_ADDRESS, H2ColumnDefine.Type.Boolean.name()));
|
||||
addColumn(new H2ColumnDefine(ApplicationTable.COLUMN_IS_ADDRESS, H2ColumnDefine.Type.Int.name()));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -40,6 +40,6 @@ public class InstanceH2TableDefine extends H2TableDefine {
|
|||
addColumn(new H2ColumnDefine(InstanceTable.COLUMN_HEARTBEAT_TIME, H2ColumnDefine.Type.Bigint.name()));
|
||||
addColumn(new H2ColumnDefine(InstanceTable.COLUMN_OS_INFO, H2ColumnDefine.Type.Varchar.name()));
|
||||
addColumn(new H2ColumnDefine(InstanceTable.COLUMN_ADDRESS_ID, H2ColumnDefine.Type.Int.name()));
|
||||
addColumn(new H2ColumnDefine(InstanceTable.COLUMN_IS_ADDRESS, H2ColumnDefine.Type.Boolean.name()));
|
||||
addColumn(new H2ColumnDefine(InstanceTable.COLUMN_IS_ADDRESS, H2ColumnDefine.Type.Int.name()));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,4 +25,9 @@ org.apache.skywalking.apm.collector.storage.h2.define.mpool.MemoryPoolSecondMetr
|
|||
org.apache.skywalking.apm.collector.storage.h2.define.mpool.MemoryPoolMinuteMetricH2TableDefine
|
||||
org.apache.skywalking.apm.collector.storage.h2.define.mpool.MemoryPoolHourMetricH2TableDefine
|
||||
org.apache.skywalking.apm.collector.storage.h2.define.mpool.MemoryPoolDayMetricH2TableDefine
|
||||
org.apache.skywalking.apm.collector.storage.h2.define.mpool.MemoryPoolMonthMetricH2TableDefine
|
||||
org.apache.skywalking.apm.collector.storage.h2.define.mpool.MemoryPoolMonthMetricH2TableDefine
|
||||
|
||||
org.apache.skywalking.apm.collector.storage.h2.define.appcomp.ApplicationComponentMinuteH2TableDefine
|
||||
org.apache.skywalking.apm.collector.storage.h2.define.appcomp.ApplicationComponentHourH2TableDefine
|
||||
org.apache.skywalking.apm.collector.storage.h2.define.appcomp.ApplicationComponentDayH2TableDefine
|
||||
org.apache.skywalking.apm.collector.storage.h2.define.appcomp.ApplicationComponentMonthH2TableDefine
|
||||
Loading…
Reference in New Issue