colinmjj commented on code in PR #16:
URL: https://github.com/apache/incubator-uniffle/pull/16#discussion_r912900515
##########
server/src/main/java/org/apache/uniffle/server/ShuffleFlushManager.java:
##########
@@ -135,59 +139,62 @@ public void addToFlushQueue(ShuffleDataFlushEvent event) {
private void flushToFile(ShuffleDataFlushEvent event) {
- Storage storage = storageManager.selectStorage(event);
- if (!storage.canWrite()) {
- addPendingEvents(event);
- return;
- }
-
long start = System.currentTimeMillis();
List<ShufflePartitionedBlock> blocks = event.getShuffleBlocks();
boolean writeSuccess = false;
try {
- if (blocks == null || blocks.isEmpty()) {
- LOG.info("There is no block to be flushed: " + event);
- } else if (!event.isValid()) {
- // avoid printing error log
- writeSuccess = true;
- LOG.warn("AppId {} was removed already, event {} should be dropped",
event.getAppId(), event);
- } else {
- ShuffleWriteHandler handler = storage.getOrCreateWriteHandler(new
CreateShuffleWriteHandlerRequest(
- storageType,
- event.getAppId(),
- event.getShuffleId(),
- event.getStartPartition(),
- event.getEndPartition(),
- storageBasePaths,
- shuffleServerId,
- hadoopConf,
- storageDataReplica));
+ Storage storage = storageManager.selectStorage(event);
+ // storage info maybe null if the application cache was cleared already
+ if (storage != null) {
+ if (!storage.canWrite()) {
+ addPendingEvents(event);
Review Comment:
right, it should be out of the try block.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]