com.clickzetta.platform.client.api.SuccessMessage Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of clickzetta-java Show documentation
Show all versions of clickzetta-java Show documentation
The java SDK for clickzetta's Lakehouse
package com.clickzetta.platform.client.api;
import com.google.common.collect.Lists;
import cz.proto.ingestion.Ingestion;
import java.util.Comparator;
import java.util.List;
import java.util.stream.Collectors;
public class SuccessMessage implements Message {
Ingestion.DataMutateRequest request;
Ingestion.DataMutateResponse response;
final String sessionId;
final String schemaName;
final String tableName;
public SuccessMessage(
String sessionId,
Ingestion.DataMutateRequest request,
Ingestion.DataMutateResponse response) {
this.sessionId = sessionId;
this.request = request;
this.response = response;
this.schemaName = request.getSchemaName();
this.tableName = request.getTableName();
}
@Override
public String getSessionId() {
return sessionId;
}
@Override
public long getBatchId() {
return request.getBatchId();
}
@Override
public long getTimestamp() {
return request.getWriteTimestamp();
}
@Override
public List getSchemaName() {
return Lists.newArrayList(schemaName);
}
@Override
public List getTableName() {
return Lists.newArrayList(tableName);
}
@Override
public long getTotalRowsCounts() {
return request.getBatchCount();
}
@Override
public List getRowStates() {
return response.getRowStatusList()
.stream().sorted(Comparator.comparingInt(Ingestion.MutateRowStatus::getRowIndex))
.collect(Collectors.toList());
}
@Override
public int getErrorRowsCounts() {
return 0;
}
@Override
public List getErrorRows() {
return null;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy