I am having two nodes running on local machine.
Following is the logic i implemented to load data using Data Steamer.Can you
please check whether the implementation is correct and also can you please
share sample code on how to push
entries to data streamer from multiple threads
public class PerformanceCacheStore {
public static void main(String[] args) throws Exception {
String url ="..";
try( Ignite ignite = Ignition.start("Ignite-Client.xml");
Connection conn = DriverManager.getConnection(url,"..",
"..");
PreparedStatement stmt =
conn.prepareStatement("select .. where
COUNTRY_CODE=? and
as_of_Date_Std=?");
) {
IgniteDataStreamer<PieProductPerformanceKey,
PieProductPerformance>
stmr = ignite.dataStreamer("PieProductPerformanceCache");
stmt.setString(1,"USA");
stmt.setString(2,"31-Dec-2019");
ResultSet rs = stmt.executeQuery();
while (rs.next()) {
PieProductPerformance perf=new PieProductPerformance();
/*
perf Setter Methods
*/
PieProductPerformanceKey perfkey=new
PieProductPerformanceKey();
/*
perfKey Setter Methods
*/
stmr.addData(perfkey, perf);
}
System.out.println("Completed");
}
}
}
--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/