use of io.hetu.core.statestore.hazelcast.HazelcastStateStoreFactory in project hetu-core by openlookeng.
the class TestStateStoreLauncherAndProvider method setUp.
// setup for test provider
@BeforeTest
private void setUp() throws IOException {
Set<Seed> seeds = new HashSet<>();
SeedStore mockSeedStore = mock(SeedStore.class);
Seed mockSeed = mock(Seed.class);
seeds.add(mockSeed);
SeedStoreManager mockSeedStoreManager = mock(SeedStoreManager.class);
when(mockSeedStoreManager.getSeedStore(SeedStoreSubType.HAZELCAST)).thenReturn(mockSeedStore);
when(mockSeed.getLocation()).thenReturn(LOCALHOST + ":" + PORT3);
when(mockSeedStore.get()).thenReturn(seeds);
factory = new HazelcastStateStoreFactory();
stateStoreProvider = new LocalStateStoreProvider(mockSeedStoreManager);
stateStoreProvider.addStateStoreFactory(factory);
}
use of io.hetu.core.statestore.hazelcast.HazelcastStateStoreFactory in project hetu-core by openlookeng.
the class TestDynamicFilterSourceOperator method prepareConfigFiles.
@BeforeTest
private void prepareConfigFiles() throws Exception {
File launcherConfigFile = new File(STATE_STORE_CONFIGURATION_PATH);
if (launcherConfigFile.exists()) {
launcherConfigFile.delete();
}
launcherConfigFile.createNewFile();
FileWriter configWriter = new FileWriter(STATE_STORE_CONFIGURATION_PATH);
configWriter.write("state-store.type=hazelcast\n" + "state-store.name=test\n" + "state-store.cluster=test-cluster\n" + "hazelcast.discovery.mode=tcp-ip\n" + "hazelcast.discovery.port=7980\n");
configWriter.close();
Set<Seed> seeds = new HashSet<>();
SeedStore mockSeedStore = mock(SeedStore.class);
Seed mockSeed = mock(Seed.class);
seeds.add(mockSeed);
SeedStoreManager mockSeedStoreManager = mock(SeedStoreManager.class);
when(mockSeedStoreManager.getSeedStore(SeedStoreSubType.HAZELCAST)).thenReturn(mockSeedStore);
when(mockSeed.getLocation()).thenReturn("127.0.0.1:6991");
when(mockSeedStore.get()).thenReturn(seeds);
StateStoreFactory factory = new HazelcastStateStoreFactory();
stateStoreProvider = new LocalStateStoreProvider(mockSeedStoreManager);
stateStoreProvider.addStateStoreFactory(factory);
createStateStoreCluster("6991");
stateStoreProvider.loadStateStore();
}
use of io.hetu.core.statestore.hazelcast.HazelcastStateStoreFactory in project hetu-core by openlookeng.
the class TestHetuMetastoreGlobalCache method setUpHazelcast.
@BeforeTest
private void setUpHazelcast() throws IOException {
Set<Seed> seeds = new HashSet<>();
SeedStore mockSeedStore = mock(SeedStore.class);
Seed mockSeed = mock(Seed.class);
seeds.add(mockSeed);
SeedStoreManager mockSeedStoreManager = mock(SeedStoreManager.class);
when(mockSeedStoreManager.getSeedStore(any(SeedStoreSubType.class))).thenReturn(mockSeedStore);
when(mockSeed.getLocation()).thenReturn(LOCALHOST + ":" + PORT3);
when(mockSeedStore.get()).thenReturn(seeds);
factory = new HazelcastStateStoreFactory();
stateStoreProvider = new LocalStateStoreProvider(mockSeedStoreManager);
stateStoreProvider.addStateStoreFactory(factory);
}
Aggregations