java multithread copy stream
Hello,
I'm migrating data from a legacy time series database into a Vertica database using copy stream via the Java API.
At the moment, everything is done sequentially:
1. Generate a copy statement for the target Vertica table
2. Create a child thread:
a) Create a PipedInputStream/PipedOutputStream pair
b) Obtain a connection from a Vertica node (data source) -- autocommit off
c) Start a Vertica copy stream using the copy statement, listening to the PipedInputStream
d) Child thread will commit the copy statement and close connection once PipedInputStream is closed by Parent (once Parent has finished streaming)
3. Parent queries and streams time series one by one, sequentially, to the child thread using the PipedOutputStream
There is only one Vertica target table.
Can I parallelize these steps to a single Vertica node (data source)?
If our Vertica setup consists of three nodes (data sources), does that mean I can only have up to three parallel threads doing steps 1-3, each one pinned to a different Vertica node?
Thank you!
I'm migrating data from a legacy time series database into a Vertica database using copy stream via the Java API.
At the moment, everything is done sequentially:
1. Generate a copy statement for the target Vertica table
2. Create a child thread:
a) Create a PipedInputStream/PipedOutputStream pair
b) Obtain a connection from a Vertica node (data source) -- autocommit off
c) Start a Vertica copy stream using the copy statement, listening to the PipedInputStream
d) Child thread will commit the copy statement and close connection once PipedInputStream is closed by Parent (once Parent has finished streaming)
3. Parent queries and streams time series one by one, sequentially, to the child thread using the PipedOutputStream
There is only one Vertica target table.
Can I parallelize these steps to a single Vertica node (data source)?
If our Vertica setup consists of three nodes (data sources), does that mean I can only have up to three parallel threads doing steps 1-3, each one pinned to a different Vertica node?
Thank you!
Sign up
Already have an account? Login
Welcome to the Rocket Forum!
Please log in or register:
Employee Login | Registration Member Login | RegistrationEnter your E-mail address. We'll send you an e-mail with instructions to reset your password.
UDF
