use of org.apache.thrift.TSerializer in project hive by apache.
the class MetadataJSONSerializer method serializePartitionSpec.
@Override
@InterfaceAudience.LimitedPrivate({ "Hive" })
@InterfaceStability.Evolving
public List<String> serializePartitionSpec(HCatPartitionSpec hcatPartitionSpec) throws HCatException {
try {
List<String> stringReps = new ArrayList<String>();
TSerializer serializer = new TSerializer(new TJSONProtocol.Factory());
for (PartitionSpec partitionSpec : hcatPartitionSpec.partitionSpecProxy.toPartitionSpec()) {
stringReps.add(serializer.toString(partitionSpec));
}
return stringReps;
} catch (TException serializationException) {
throw new HCatException("Failed to serialize!", serializationException);
}
}
use of org.apache.thrift.TSerializer in project vcell by virtualcell.
the class CopasiServicePython method writeOptRunJson.
public static void writeOptRunJson(File optRunFile, OptRun optRun) throws IOException {
TSerializer serializer = new TSerializer(new TJSONProtocol.Factory());
try {
byte[] blob = serializer.serialize(optRun);
FileUtils.writeByteArrayToFile(optRunFile, blob);
} catch (TException e) {
e.printStackTrace();
throw new IOException("error writing optProblem to file " + optRunFile.getPath() + ": " + e.getMessage(), e);
}
}
use of org.apache.thrift.TSerializer in project vcell by virtualcell.
the class CopasiServicePython method writeOptProblem.
public static void writeOptProblem(File optProblemFile, OptProblem optProblem) throws IOException {
TSerializer serializer = new TSerializer(new TBinaryProtocol.Factory());
try {
byte[] blob = serializer.serialize(optProblem);
FileUtils.writeByteArrayToFile(optProblemFile, blob);
} catch (TException e) {
e.printStackTrace();
throw new IOException("error writing optProblem to file " + optProblemFile.getPath() + ": " + e.getMessage(), e);
}
}
use of org.apache.thrift.TSerializer in project vcell by virtualcell.
the class CopasiServicePython method writeOptProblemJson.
public static void writeOptProblemJson(File optProblemFile, OptProblem optProblem) throws IOException {
TSerializer serializer = new TSerializer(new TJSONProtocol.Factory());
try {
byte[] blob = serializer.serialize(optProblem);
FileUtils.writeByteArrayToFile(optProblemFile, blob);
} catch (TException e) {
e.printStackTrace();
throw new IOException("error writing optProblem to file " + optProblemFile.getPath() + ": " + e.getMessage(), e);
}
}
use of org.apache.thrift.TSerializer in project vcell by virtualcell.
the class VisMeshUtils method writeSimulationDataSetRef.
public static void writeSimulationDataSetRef(File simDataSetRefFile, SimulationDataSetRef simDataSetRef) throws IOException {
TSerializer serializer = new TSerializer(new TBinaryProtocol.Factory());
try {
byte[] blob = serializer.serialize(simDataSetRef);
FileUtils.writeByteArrayToFile(simDataSetRefFile, blob);
} catch (TException e) {
e.printStackTrace();
throw new IOException("error writing SimulationDataSetRef to file " + simDataSetRefFile.getPath() + ": " + e.getMessage(), e);
}
}
Aggregations