code: private void closeCurrentPartFile(BucketState<T> bucketState) throws Exception {
  		if (bucketState.isWriterOpen) {
  			bucketState.writer.close();
  			bucketState.isWriterOpen = false;
  		}
  
  		if (bucketState.currentFile != null) {
  			Path currentPartPath = new Path(bucketState.currentFile);
  			Path inProgressPath = getInProgressPathFor(currentPartPath);
  			Path pendingPath = getPendingPathFor(currentPartPath);
  
  			fs.rename(inProgressPath, pendingPath);
  			LOG.debug("Moving in-progress bucket {} to pending file {}",
  				inProgressPath,
  				pendingPath);
  			bucketState.pendingFiles.add(currentPartPath.toString());
  			bucketState.currentFile = null;
  		}
  	}
docs: Closes the current part file and moves it from the in-progress state to the pending state.