Skip to content

Commit

Permalink
fix comments
Browse files Browse the repository at this point in the history
  • Loading branch information
xloya committed Sep 6, 2024
1 parent 5edebdc commit 3b36e37
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ public String getFileLocation(NameIdentifier ident, String subPath)
CallerContext callerContext = CallerContext.CallerContextHolder.get();

Map<String, String> params = new HashMap<>();
params.put("subPath", RESTUtils.encodeString(subPath));
params.put("sub_path", RESTUtils.encodeString(subPath));
FileLocationResponse resp =
restClient.get(
formatFileLocationRequestPath(fullNamespace, ident.name()),
Expand Down Expand Up @@ -280,7 +280,7 @@ static String formatFileLocationRequestPath(Namespace ns, String name) {
.append(RESTUtils.encodeString(ns.level(2)))
.append("/filesets/")
.append(RESTUtils.encodeString(name))
.append("/fileLocation")
.append("/location")
.toString();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ public void testGetFileLocation() throws JsonProcessingException {
FilesetCatalog.formatFileLocationRequestPath(
Namespace.of(metalakeName, catalogName, "schema1"), fileset.name()));
Map<String, String> queryParams = new HashMap<>();
queryParams.put("subPath", RESTUtils.encodeString(mockSubPath));
queryParams.put("sub_path", RESTUtils.encodeString(mockSubPath));

String mockFileLocation =
String.format("file:/fileset/%s/%s/%s/%s", catalogName, "schema1", "fileset1", mockSubPath);
Expand All @@ -449,7 +449,7 @@ public void testCallerContextToHeader() throws JsonProcessingException {
FilesetCatalog.formatFileLocationRequestPath(
Namespace.of(metalakeName, catalogName, "schema1"), fileset.name()));
Map<String, String> queryParams = new HashMap<>();
queryParams.put("subPath", RESTUtils.encodeString(mockSubPath));
queryParams.put("sub_path", RESTUtils.encodeString(mockSubPath));
String mockFileLocation =
String.format("file:/fileset/%s/%s/%s/%s", catalogName, "schema1", "fileset1", mockSubPath);
FileLocationResponse resp = new FileLocationResponse(mockFileLocation);
Expand Down
6 changes: 3 additions & 3 deletions docs/open-api/filesets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ paths:
"5xx":
$ref: "./openapi.yaml#/components/responses/ServerErrorResponse"

/metalakes/{metalake}/catalogs/{catalog}/schemas/{schema}/filesets/{fileset}/fileLocation:
/metalakes/{metalake}/catalogs/{catalog}/schemas/{schema}/filesets/{fileset}/location:
parameters:
- $ref: "./openapi.yaml#/components/parameters/metalake"
- $ref: "./openapi.yaml#/components/parameters/catalog"
Expand All @@ -166,12 +166,12 @@ paths:

get:
tags:
- fileLocation
- location
summary: Get file location
operationId: getFileLocation
description: Returns the specified file location object
parameters:
- name: subPath
- name: sub_path
in: query
required: true
schema:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ public Response dropFileset(
}

@GET
@Path("{fileset}/fileLocation")
@Path("{fileset}/location")
@Produces("application/vnd.gravitino.v1+json")
@Timed(name = "get-file-location." + MetricNames.HTTP_PROCESS_DURATION, absolute = true)
@ResponseMetered(name = "get-file-location", absolute = true)
Expand All @@ -261,7 +261,7 @@ public Response getFileLocation(
@PathParam("catalog") String catalog,
@PathParam("schema") String schema,
@PathParam("fileset") String fileset,
@QueryParam("subPath") @NotNull String subPath) {
@QueryParam("sub_path") @NotNull String subPath) {
LOG.info(
"Received get file location request: {}.{}.{}.{}, sub path:{}",
metalake,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -439,8 +439,8 @@ public void testGetFileLocation() {

when(dispatcher.getFileLocation(any(), any())).thenReturn(actualPath);
Response resp =
target(filesetPath(metalake, catalog, schema) + "fileset1/fileLocation")
.queryParam("subPath", RESTUtils.encodeString("test/1"))
target(filesetPath(metalake, catalog, schema) + "fileset1/location")
.queryParam("sub_path", RESTUtils.encodeString("test/1"))
.request(MediaType.APPLICATION_JSON_TYPE)
.accept("application/vnd.gravitino.v1+json")
.get();
Expand Down

0 comments on commit 3b36e37

Please sign in to comment.