public class PartitionedTableAppender extends Object
PartitionedTableAppender tableAppender = new PartitionedTableAppender("Trades", "192.168.1.25", 8848);
List<Entity> row = new ArrayList<>();
row.add(BasicInt(1));
row.add(BasicString('A'));
int affected = tableAppender.append(row);
// append multiple rows at a time
List<Entity> rows = new ArrayList<>();
BasicIntVector vint = new BasicIntVector(Arrays.asList(1,2,3,4,5));
BasicStringVector vstring = new BasicStringVector(Arrays.asList("A", "B", "C", "D", "E"));
rows.add(vint);
rows.add(vstring);
affected = tableAppender.append(rows);
// cleanup
tableAppender.shutdownThreadPool();
| Constructor and Description |
|---|
PartitionedTableAppender(String tableName,
String host,
int port) |
PartitionedTableAppender(String tableName,
String host,
int port,
int threadCount) |
| Modifier and Type | Method and Description |
|---|---|
int |
append(List<Entity> row)
Append a list of columns to the table.
|
void |
shutdownThreadPool() |
public PartitionedTableAppender(String tableName, String host, int port) throws IOException
tableName - name of the shared tablehost - hostport - portIOExceptionpublic PartitionedTableAppender(String tableName, String host, int port, int threadCount) throws IOException
IOExceptionpublic int append(List<Entity> row) throws IOException
row - IOExceptionpublic void shutdownThreadPool()
Copyright © 2019 DolphinDB. All rights reserved.