com.hazelcast.core.ItemEvent Java Examples

The following examples show how to use com.hazelcast.core.ItemEvent. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: HzCacheGateway.java    From DeepMachineLearning with Apache License 2.0 5 votes vote down vote up
@Override
public void itemAdded(ItemEvent<Object> event) {
	System.out.println("Item added: " + event);
	IMap<Object, Object> generateMap = hz.getMap("generate-map");
	
	AclfTrainDataGenerator dataGen = new AclfTrainDataGenerator();
	//read case
	String filename = generateMap.get("Path").toString();
	dataGen.loadCase(filename, generateMap.get("Builder").toString());
	int trainPoint= (int) generateMap.get("Train_Points");
	String[][] tranSet = dataGen.getTrainSet(trainPoint);
	hz.getMap("data-map").put("input",tranSet[0]);
	hz.getMap("data-map").put("output", tranSet[1]);
	hz.getQueue("finish-queue").add("finish");
}
 
Example #2
Source File: HazelcastWorkQueue.java    From telekom-workflow-engine with MIT License 5 votes vote down vote up
@Override
public void itemRemoved( ItemEvent<WorkUnit> e ){
    if( queue.isEmpty() ){
        synchronized( monitor ){
            monitor.notifyAll();
        }
    }
}
 
Example #3
Source File: ItemListenerImpl.java    From java-11-examples with Apache License 2.0 4 votes vote down vote up
@Override
public void itemAdded(ItemEvent<String> item) {
    LOG.info("itemAdded: {} {}", item.getEventType().getType(), item.getItem());
    listener.onMessage(item.getItem());
}
 
Example #4
Source File: ItemListenerImpl.java    From java-11-examples with Apache License 2.0 4 votes vote down vote up
@Override
public void itemRemoved(ItemEvent<String> item) {
    LOG.info("itemRemoved: {} {}", item.getEventType().getType(), item.getItem());
}
 
Example #5
Source File: HzCacheGateway.java    From DeepMachineLearning with Apache License 2.0 4 votes vote down vote up
@Override
public void itemRemoved(ItemEvent<Object> event) {
	System.out.println("Item removed: " + event);
}
 
Example #6
Source File: HazelcastWorkQueue.java    From telekom-workflow-engine with MIT License 4 votes vote down vote up
@Override
public void itemAdded( ItemEvent<WorkUnit> event ){
}