Skip to content

Commit

Permalink
Merge 958d4f3 into b8a09d0
Browse files Browse the repository at this point in the history
  • Loading branch information
karankm97 authored Dec 24, 2024
2 parents b8a09d0 + 958d4f3 commit e12958d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lakeview/src/main/java/ai/onehouse/api/OnehouseApiClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import static ai.onehouse.constants.ApiConstants.GET_TABLE_METRICS_CHECKPOINT;
import static ai.onehouse.constants.ApiConstants.INITIALIZE_TABLE_METRICS_CHECKPOINT;
import static ai.onehouse.constants.ApiConstants.LINK_UID_KEY;
import static ai.onehouse.constants.ApiConstants.MAINTENANCE_MODE_KEY;
import static ai.onehouse.constants.ApiConstants.ONEHOUSE_API_ENDPOINT;
import static ai.onehouse.constants.ApiConstants.ONEHOUSE_API_KEY;
import static ai.onehouse.constants.ApiConstants.ONEHOUSE_API_SECRET_KEY;
Expand Down Expand Up @@ -114,6 +115,9 @@ Headers getHeaders(OnehouseClientConfig onehouseClientConfig) {
if (StringUtils.isNotEmpty(onehouseClientConfig.getRegion())) {
headersBuilder.add(ONEHOUSE_REGION_KEY, onehouseClientConfig.getRegion());
}
if (onehouseClientConfig.getMaintenanceMode() != null && onehouseClientConfig.getMaintenanceMode().equals(Boolean.TRUE)) {
headersBuilder.add(MAINTENANCE_MODE_KEY, Boolean.TRUE.toString());
}
return headersBuilder.build();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,5 @@ public class OnehouseClientConfig {
@Nullable private String apiSecret;
@Nullable private String userId;
@Nullable private String file;
@Nullable private Boolean maintenanceMode;
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ private ApiConstants() {}
public static final String LINK_UID_KEY = "x-onehouse-link-uid";
public static final String ONEHOUSE_REGION_KEY = "x-onehouse-region";
public static final String ONEHOUSE_USER_UUID_KEY = "x-onehouse-uuid";
public static final String MAINTENANCE_MODE_KEY = "x-maintenance-mode";
// using mapping from:
// https://chromium.googlesource.com/external/github.com/grpc/grpc/+/refs/tags/v1.21.4-pre1/doc/statuscodes.md
public static final List<Integer> ACCEPTABLE_HTTP_FAILURE_STATUS_CODES =
Expand Down

0 comments on commit e12958d

Please sign in to comment.