Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
*/
package org.apache.pinot.plugin.ingestion.batch.common;

import com.google.common.base.Preconditions;
import java.io.File;
import java.io.IOException;
import java.net.URI;
Expand Down Expand Up @@ -113,8 +112,8 @@ public List<String> getSegmentsToReplace(Map<String, String> segmentsUriToTarPat
for (String tarFilePath : tarFilePaths) {
File tarFile = new File(tarFilePath);
String fileName = tarFile.getName();
Preconditions.checkArgument(fileName.endsWith(Constants.TAR_GZ_FILE_EXT));
String segmentName = fileName.substring(0, fileName.length() - Constants.TAR_GZ_FILE_EXT.length());
String segmentName = fileName.endsWith(Constants.TAR_GZ_FILE_EXT)
? fileName.substring(0, fileName.length() - Constants.TAR_GZ_FILE_EXT.length()) : fileName;
segmentNames.add(segmentName);
}
return segmentNames;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
*/
package org.apache.pinot.segment.local.utils;

import com.google.common.base.Preconditions;
import java.io.File;
import java.io.InputStream;
import java.io.Serializable;
Expand Down Expand Up @@ -152,8 +151,8 @@ public static void pushSegments(SegmentGenerationJobSpec spec, PinotFS fileSyste
URI tarFileURI = URI.create(tarFilePath);
File tarFile = new File(tarFilePath);
String fileName = tarFile.getName();
Preconditions.checkArgument(fileName.endsWith(Constants.TAR_GZ_FILE_EXT));
String segmentName = fileName.substring(0, fileName.length() - Constants.TAR_GZ_FILE_EXT.length());
String segmentName = fileName.endsWith(Constants.TAR_GZ_FILE_EXT)
? fileName.substring(0, fileName.length() - Constants.TAR_GZ_FILE_EXT.length()) : fileName;
for (PinotClusterSpec pinotClusterSpec : spec.getPinotClusterSpecs()) {
URI controllerURI;
try {
Expand Down Expand Up @@ -370,6 +369,7 @@ public static Map<String, String> getSegmentUriToTarPathMap(URI outputDirURI, Pu
for (String file : files) {
if (pushFilePathMatcher != null) {
if (!pushFilePathMatcher.matches(Paths.get(file))) {
LOGGER.info("Ignoring file {}", file);
continue;
}
}
Expand All @@ -379,11 +379,11 @@ public static Map<String, String> getSegmentUriToTarPathMap(URI outputDirURI, Pu
// Skip segment metadata tar gz files
continue;
}
if (uri.getPath().endsWith(Constants.TAR_GZ_FILE_EXT)) {
URI updatedURI = SegmentPushUtils.generateSegmentTarURI(outputDirURI, uri, pushSpec.getSegmentUriPrefix(),
pushSpec.getSegmentUriSuffix());
segmentUriToTarPathMap.put(updatedURI.toString(), file);
}
//if (uri.getPath().endsWith(Constants.TAR_GZ_FILE_EXT)) {
URI updatedURI = SegmentPushUtils.generateSegmentTarURI(outputDirURI, uri, pushSpec.getSegmentUriPrefix(),
pushSpec.getSegmentUriSuffix());
segmentUriToTarPathMap.put(updatedURI.toString(), file);
//}
}
return segmentUriToTarPathMap;
}
Expand Down