List of usage examples for org.apache.hadoop.yarn.api.protocolrecords.impl.pb AllocateResponsePBImpl getProto
public synchronized AllocateResponseProto getProto()
From source file:io.hops.ha.common.TransactionStateImpl.java
License:Apache License
private void persistAllocateResponsesToAdd() throws IOException { if (!allocateResponsesToAdd.isEmpty()) { AllocateResponseDataAccess da = (AllocateResponseDataAccess) RMStorageFactory .getDataAccess(AllocateResponseDataAccess.class); List<AllocateResponse> toAdd = new ArrayList<AllocateResponse>(); for (ApplicationAttemptId id : allocateResponsesToAdd.keySet()) { if (!allocateResponsesToRemove.remove(id)) { AllocateResponseLock lock = allocateResponsesToAdd.get(id); synchronized (lock) { AllocateResponsePBImpl lastResponse = (AllocateResponsePBImpl) lock.getAllocateResponse(); if (lastResponse != null) { toAdd.add(new AllocateResponse(id.toString(), lastResponse.getProto().toByteArray())); }// w w w . j av a2 s . co m } } } da.addAll(toAdd); } }