You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by ti...@apache.org on 2021/05/26 05:13:56 UTC
[incubator-pinot] branch master updated: Fix deep store directory
structure (#6976)
This is an automated email from the ASF dual-hosted git repository.
tingchen pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-pinot.git
The following commit(s) were added to refs/heads/master by this push:
new b8a92c4 Fix deep store directory structure (#6976)
b8a92c4 is described below
commit b8a92c41e3d063c436e37965ade577ff8e2b5f86
Author: Sajjad Moradi <mo...@gmail.com>
AuthorDate: Tue May 25 22:13:32 2021 -0700
Fix deep store directory structure (#6976)
* Fix deep store directory strucure
* tableName -> rawTableName
* extract raw table name
* fix integration test
---
.../api/resources/PinotSegmentUploadDownloadRestletResource.java | 8 ++++----
.../pinot/controller/helix/ControllerRequestURLBuilder.java | 4 ++--
.../pinot/integration/tests/BasicAuthRealtimeIntegrationTest.java | 2 +-
3 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/pinot-controller/src/main/java/org/apache/pinot/controller/api/resources/PinotSegmentUploadDownloadRestletResource.java b/pinot-controller/src/main/java/org/apache/pinot/controller/api/resources/PinotSegmentUploadDownloadRestletResource.java
index 35a3e07..98383ca 100644
--- a/pinot-controller/src/main/java/org/apache/pinot/controller/api/resources/PinotSegmentUploadDownloadRestletResource.java
+++ b/pinot-controller/src/main/java/org/apache/pinot/controller/api/resources/PinotSegmentUploadDownloadRestletResource.java
@@ -292,7 +292,7 @@ public class PinotSegmentUploadDownloadRestletResource {
tableNameWithType);
zkDownloadUri = downloadUri;
} else {
- zkDownloadUri = getZkDownloadURIForSegmentUpload(tableNameWithType, segmentName);
+ zkDownloadUri = getZkDownloadURIForSegmentUpload(rawTableName, segmentName);
}
// Zk operations
@@ -389,9 +389,9 @@ public class PinotSegmentUploadDownloadRestletResource {
String tableNameWithType, SegmentMetadata segmentMetadata, String segmentName, String zkDownloadURI,
boolean moveSegmentToFinalLocation, String crypter)
throws Exception {
- URI finalSegmentLocationURI = URIUtils
- .getUri(ControllerFilePathProvider.getInstance().getDataDirURI().toString(), tableNameWithType,
- URIUtils.encode(segmentName));
+ String basePath = ControllerFilePathProvider.getInstance().getDataDirURI().toString();
+ String rawTableName = TableNameBuilder.extractRawTableName(tableNameWithType);
+ URI finalSegmentLocationURI = URIUtils.getUri(basePath, rawTableName, URIUtils.encode(segmentName));
ZKOperator zkOperator = new ZKOperator(_pinotHelixResourceManager, _controllerConf, _controllerMetrics);
zkOperator.completeSegmentOperations(tableNameWithType, segmentMetadata, finalSegmentLocationURI, uploadedSegmentFile,
enableParallelPushProtection, headers, zkDownloadURI, moveSegmentToFinalLocation, crypter);
diff --git a/pinot-controller/src/main/java/org/apache/pinot/controller/helix/ControllerRequestURLBuilder.java b/pinot-controller/src/main/java/org/apache/pinot/controller/helix/ControllerRequestURLBuilder.java
index cea7582..9d3b362 100644
--- a/pinot-controller/src/main/java/org/apache/pinot/controller/helix/ControllerRequestURLBuilder.java
+++ b/pinot-controller/src/main/java/org/apache/pinot/controller/helix/ControllerRequestURLBuilder.java
@@ -255,8 +255,8 @@ public class ControllerRequestURLBuilder {
return StringUtil.join("/", _baseUrl, "tableConfigs", "validate");
}
- public String forSegmentDownload(String tableNameWithType, String segmentName) {
- return URIUtils.constructDownloadUrl(_baseUrl, tableNameWithType, segmentName);
+ public String forSegmentDownload(String tableName, String segmentName) {
+ return URIUtils.constructDownloadUrl(_baseUrl, tableName, segmentName);
}
public String forSegmentDelete(String tableName, String segmentName) {
diff --git a/pinot-integration-tests/src/test/java/org/apache/pinot/integration/tests/BasicAuthRealtimeIntegrationTest.java b/pinot-integration-tests/src/test/java/org/apache/pinot/integration/tests/BasicAuthRealtimeIntegrationTest.java
index f10b198..05c2264 100644
--- a/pinot-integration-tests/src/test/java/org/apache/pinot/integration/tests/BasicAuthRealtimeIntegrationTest.java
+++ b/pinot-integration-tests/src/test/java/org/apache/pinot/integration/tests/BasicAuthRealtimeIntegrationTest.java
@@ -184,7 +184,7 @@ public class BasicAuthRealtimeIntegrationTest extends BaseClusterIntegrationTest
for (int i = 0; i < offlineSegments.size(); i++) {
String segment = offlineSegments.get(i).asText();
Assert.assertTrue(sendGetRequest(_controllerRequestURLBuilder
- .forSegmentDownload(TableNameBuilder.OFFLINE.tableNameWithType(getTableName()), segment), AUTH_HEADER)
+ .forSegmentDownload(getTableName(), segment), AUTH_HEADER)
.length() > 200000); // download segment
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org