0
우리의 poc에서는 분할 모드로 2 개의 백업이있는 캐시가 있고 노드를 3 개 시작했습니다. 100 개의 항목이 캐시에로드되었고이를 복구하기위한 단계가있었습니다.primaryValues는 예상대로 동작하지 않습니다.
public void perform() throws GridException {
final GridCache<Long, Entity> cache= g.cache("cache");
GridProjection proj= g.forCache("cache");
Collection< Collection<Entity>> list= proj .compute().broadcast(
new GridCallable< Collection<Entity>>() {
@Override public Collection<Entity> call() throws Exception {
Collection<Entity> values= cache.primaryValues();
System.out.println("List size on each Node: "+ values.size());
// console from each node shows 28,38,34 respectively, which is correct
return values;
}
}).get();
for (Collection<Entity> e: list){
System.out.println("list size when arrives on main Node :"+ e.size());
//console shows 28 for three times, which is not correct
}
}
나는 primaryValues는() 밖으로 primaryEntrySet에 의해 반환 된 각 요소()의 값을 가지고 컬렉션에 투입하는 것으로 가정합니다. 나 또한 primaryEntrySet을 사용하려고 시도하고 그런 문제없이 작동합니다.
이 작품, 고마워! 내가 언급 한 것을 잊어 버렸습니다.이 방법은 REPLICATED 모드에서 잘 작동합니다. –