}
}
}
else if(!remoteQ.isEmpty()) {
wait=false;
Client client=new ESClient().getClient();
BulkRequestBuilder bulk=client.prepareBulk();
final ArrayList<IndexJournal<String>> recordsToDelete=new ArrayList<IndexJournal<String>>();
while(!remoteQ.isEmpty()) {
IndexJournal<String> idx = remoteQ.removeFirst();
writeDocumentToIndex(bulk,idx);
recordsToDelete.add(idx);