
com.alicloud.openservices.tablestore.model.timeseries.GetTimeseriesDataRequest Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of tablestore Show documentation
Show all versions of tablestore Show documentation
Aliyun Open Services SDK for Java Copyright (C) Alibaba Cloud Computing All rights reserved. 版权所有
(C)阿里云计算有限公司 http://www.aliyun.com
The newest version!
package com.alicloud.openservices.tablestore.model.timeseries;
import com.alicloud.openservices.tablestore.core.utils.Pair;
import com.alicloud.openservices.tablestore.core.utils.Preconditions;
import com.alicloud.openservices.tablestore.model.ColumnType;
import com.alicloud.openservices.tablestore.model.OperationNames;
import com.alicloud.openservices.tablestore.model.Request;
import java.util.ArrayList;
import java.util.List;
public class GetTimeseriesDataRequest implements Request {
private final String timeseriesTableName;
private TimeseriesKey timeseriesKey;
private long beginTimeInUs;
private long endTimeInUs;
private int limit = -1;
private byte[] nextToken;
private boolean backward;
private List> fieldsToGet;
public GetTimeseriesDataRequest(String timeseriesTableName) {
this.timeseriesTableName = timeseriesTableName;
}
public String getTimeseriesTableName() {
return timeseriesTableName;
}
public TimeseriesKey getTimeseriesKey() {
return timeseriesKey;
}
public void setTimeseriesKey(TimeseriesKey timeseriesKey) {
this.timeseriesKey = timeseriesKey;
}
public void setTimeRange(long beginTimeInUs, long endTimeInUs) {
Preconditions.checkArgument(beginTimeInUs >= 0, "begin time must be large than or equal to 0");
Preconditions.checkArgument(endTimeInUs > 0, "end time must be large than 0");
this.beginTimeInUs = beginTimeInUs;
this.endTimeInUs = endTimeInUs;
}
public long getBeginTimeInUs() {
return beginTimeInUs;
}
public long getEndTimeInUs() {
return endTimeInUs;
}
public void setNextToken(byte[] nextToken) {
this.nextToken = nextToken;
}
public byte[] getNextToken() {
return nextToken;
}
@Override
public String getOperationName() {
return OperationNames.OP_GET_TIMESERIES_DATA;
}
public int getLimit() {
return limit;
}
public void setLimit(int limit) {
Preconditions.checkArgument(limit > 0, "limit must large than 0");
this.limit = limit;
}
public boolean isBackward() {
return backward;
}
/**
* Whether to read in reverse time order, can be used to get the latest data
* @param backward
*/
public void setBackward(boolean backward) {
this.backward = backward;
}
public List> getFieldsToGet() {
if (fieldsToGet == null) {
fieldsToGet = new ArrayList>();
}
return fieldsToGet;
}
public void setFieldsToGet(List> fieldsToGet) {
this.fieldsToGet = fieldsToGet;
}
public void addFieldToGet(String fieldName, ColumnType fieldType) {
Preconditions.checkNotNull(fieldName);
Preconditions.checkNotNull(fieldType);
if (fieldsToGet == null) {
fieldsToGet = new ArrayList>();
}
fieldsToGet.add(new Pair(fieldName, fieldType));
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy