private void fetchNextBatch() throws HCatException { batch = hcatClient.getNextNotification(pos, batchSize, filter); batchIter = batch.iterator(); if (batch.isEmpty()){ pos += batchSize; if (pos < maxPos){ fetchNextBatch(); // This way, the only way the recursive stack of fetchNextBatch returns is if: // a) We got a nonempty result, and we can consume // b) We reached the end of the queue, and there are no more events. // So, when we return from the fetchNextBatch() stack, if we have no more // results in batch, we're done. } } }
List<HCatNotificationEvent> notifs = sourceMetastore.getNextNotification( 0, 0, new IMetaStoreClient.NotificationFilter() { @Override
private void fetchNextBatch() throws HCatException { batch = hcatClient.getNextNotification(pos, batchSize, filter); batchIter = batch.iterator(); if (batch.isEmpty()){ pos += batchSize; if (pos < maxPos){ fetchNextBatch(); // This way, the only way the recursive stack of fetchNextBatch returns is if: // a) We got a nonempty result, and we can consume // b) We reached the end of the queue, and there are no more events. // So, when we return from the fetchNextBatch() stack, if we have no more // results in batch, we're done. } } }
private void fetchNextBatch() throws HCatException { batch = hcatClient.getNextNotification(pos, batchSize, filter); batchIter = batch.iterator(); if (batch.isEmpty()){ pos += batchSize; if (pos < maxPos){ fetchNextBatch(); // This way, the only way the recursive stack of fetchNextBatch returns is if: // a) We got a nonempty result, and we can consume // b) We reached the end of the queue, and there are no more events. // So, when we return from the fetchNextBatch() stack, if we have no more // results in batch, we're done. } } }
private void fetchNextBatch() throws HCatException { batch = hcatClient.getNextNotification(pos, batchSize, filter); batchIter = batch.iterator(); if (batch.isEmpty()){ pos += batchSize; if (pos < maxPos){ fetchNextBatch(); // This way, the only way the recursive stack of fetchNextBatch returns is if: // a) We got a nonempty result, and we can consume // b) We reached the end of the queue, and there are no more events. // So, when we return from the fetchNextBatch() stack, if we have no more // results in batch, we're done. } } }