Hello everybody,
the DataStreamer ignores the underlying store. Do I miss something?
Here is my test code:
// CacheConfiguration
public static CacheConfiguration<Integer, String> getCacheConfig() {
CacheJdbcBlobStoreFactory<Integer, String> blobStore = new
CacheJdbcBlobStoreFactory<>();
blobStore.setUser("sa");
blobStore.setConnectionUrl("jdbc:h2:./test");
CacheConfiguration<Integer, String> cfg = new
CacheConfiguration<>("test_cache");
cfg.setCacheStoreFactory(blobStore);
cfg.setReadThrough(true);
cfg.setWriteThrough(true);
cfg.setWriteBehindEnabled(true);
return cfg;
}
// first write to store, then read from it
public void test(){
try (Ignite ignite = Ignition.start()) {
IgniteCache<Integer, String> cache =
ignite.getOrCreateCache(getCacheConfig());
IgniteDataStreamer<Integer, String> streamer =
ignite.dataStreamer(cache.getName());
streamer.skipStore(false);
cache.put(1, "put");
streamer.addData(4, "stream");
streamer.flush();
System.out.println("Write to Store:");
System.out.println("1: "+ cache.get(1));
System.out.println("4: "+ cache.get(4));
}
try (Ignite ignite = Ignition.start()) {
IgniteCache<Integer, String> cache =
ignite.getOrCreateCache(getCacheConfig());
cache.loadCache(null);
System.out.println("Read from Store:");
System.out.println("1: "+ cache.get(1));
System.out.println("4: "+ cache.get(4));
}
}
The Result is:
Write to Store:
1: put
4: stream
Read from Store:
1: put
4: null
Thank you.
Best,
Rafael
--
Rafael Troilo, Dipl.-Inform. (FH)
GIScience Research Group
Heidelberg Institute for Geoinformation Technology
[email protected]
http://giscience.uni-hd.de
http://www.geog.uni-heidelberg.de/gis/heigit.html
Berliner Str. 45 (Mathematikon), D-69120 Heidelberg, Germany
fon: +49(0)6221 / 54 / 19704