Skip to content

Commit

Permalink
Changing signature to make parameter order correct
Browse files Browse the repository at this point in the history
  • Loading branch information
HonahX committed Mar 5, 2025
1 parent a861cd4 commit ebfcb90
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -387,10 +387,10 @@ public ResolvedEntityResult refreshResolvedEntity(
@Override
public @NotNull AttachmentResult attachPolicyToEntity(
@Nonnull PolarisCallContext callCtx,
@NotNull PolarisEntityCore target,
@NotNull List<PolarisEntityCore> targetCatalogPath,
@NotNull PolicyEntity policy,
@NotNull PolarisEntityCore target,
@NotNull List<PolarisEntityCore> policyCatalogPath,
@NotNull PolicyEntity policy,
Map<String, String> parameters) {
callCtx
.getDiagServices()
Expand All @@ -401,10 +401,10 @@ public ResolvedEntityResult refreshResolvedEntity(
@Override
public @NotNull AttachmentResult detachPolicyFromEntity(
@Nonnull PolarisCallContext callCtx,
@NotNull PolarisEntityCore target,
@NotNull List<PolarisEntityCore> catalogPath,
@NotNull PolicyEntity policy,
@NotNull List<PolarisEntityCore> policyCatalogPath) {
@NotNull PolarisEntityCore target,
@NotNull List<PolarisEntityCore> policyCatalogPath,
@NotNull PolicyEntity policy) {
callCtx
.getDiagServices()
.fail("illegal_method_in_transaction_workspace", "detachPolicyFromEntity");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2354,10 +2354,10 @@ public Map<String, String> getInternalPropertyMap(
@Override
public @NotNull AttachmentResult attachPolicyToEntity(
@Nonnull PolarisCallContext callCtx,
@Nonnull PolarisEntityCore target,
@Nonnull List<PolarisEntityCore> targetCatalogPath,
@Nonnull PolicyEntity policy,
@Nonnull PolarisEntityCore target,
@Nonnull List<PolarisEntityCore> policyCatalogPath,
@Nonnull PolicyEntity policy,
Map<String, String> parameters) {
TransactionalPersistence ms = callCtx.getMetaStore();

Expand Down Expand Up @@ -2439,10 +2439,10 @@ public Map<String, String> getInternalPropertyMap(
@Override
public @NotNull AttachmentResult detachPolicyFromEntity(
@Nonnull PolarisCallContext callCtx,
@Nonnull PolarisEntityCore target,
@Nonnull List<PolarisEntityCore> targetCatalogPath,
@Nonnull PolicyEntity policy,
@Nonnull List<PolarisEntityCore> policyCatalogPath) {
@Nonnull PolarisEntityCore target,
@Nonnull List<PolarisEntityCore> policyCatalogPath,
@Nonnull PolicyEntity policy) {
TransactionalPersistence ms = callCtx.getMetaStore();
return ms.runInTransaction(
callCtx,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ public interface PolarisPolicyMappingManager {
* non-inheritable policy, multiple policies of the same type can be attached to the target.
*
* @param callCtx call context
* @param target target entity
* @param targetCatalogPath path to the target entity
* @param policy policy entity
* @param target target entity
* @param policyCatalogPath path to the policy entity
* @param policy policy entity
* @param parameters additional parameters for the attachment
* @return The policy mapping record we created for this attachment. Will return ENTITY_NOT_FOUND
* if the specified target or policy does not exist. Will return
Expand All @@ -52,31 +52,31 @@ public interface PolarisPolicyMappingManager {
@Nonnull
AttachmentResult attachPolicyToEntity(
@Nonnull PolarisCallContext callCtx,
@Nonnull PolarisEntityCore target,
@Nonnull List<PolarisEntityCore> targetCatalogPath,
@Nonnull PolicyEntity policy,
@Nonnull PolarisEntityCore target,
@Nonnull List<PolarisEntityCore> policyCatalogPath,
@Nonnull PolicyEntity policy,
Map<String, String> parameters);

/**
* Detach a policy from a target entity
*
* @param callCtx call context
* @param target target entity
* @param catalogPath path to the target entity
* @param policy policy entity
* @param target target entity
* @param policyCatalogPath path to the policy entity
* @param policy policy entity
* @return The policy mapping record we detached. Will return ENTITY_NOT_FOUND if the specified
* target or policy does not exist. Will return POLICY_MAPPING_NOT_FOUND if the mapping cannot
* be found
*/
@Nonnull
AttachmentResult detachPolicyFromEntity(
@Nonnull PolarisCallContext callCtx,
@Nonnull PolarisEntityCore target,
@Nonnull List<PolarisEntityCore> catalogPath,
@Nonnull PolicyEntity policy,
@Nonnull List<PolarisEntityCore> policyCatalogPath);
@Nonnull PolarisEntityCore target,
@Nonnull List<PolarisEntityCore> policyCatalogPath,
@Nonnull PolicyEntity policy);

/**
* Load all policies attached to a target entity
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2327,10 +2327,10 @@ void testPolicyMapping() {

polarisMetaStoreManager.attachPolicyToEntity(
polarisCallContext,
N1_N2_T1,
List.of(catalog, N1, N1_N2),
PolicyEntity.of(N1_P1),
N1_N2_T1,
List.of(catalog, N1),
PolicyEntity.of(N1_P1),
null);
PolarisPolicyMappingManager.LoadPolicyMappingsResult directSearch =
polarisMetaStoreManager.loadPoliciesOnEntity(polarisCallContext, N1_N2_T1);
Expand All @@ -2351,10 +2351,10 @@ void testPolicyMapping() {
.isEqualTo(PredefinedPolicyType.DATA_COMPACTION);
polarisMetaStoreManager.detachPolicyFromEntity(
polarisCallContext,
N1_N2_T1,
List.of(catalog, N1, N1_N2),
PolicyEntity.of(N1_P1),
List.of(catalog, N1));
N1_N2_T1,
List.of(catalog, N1),
PolicyEntity.of(N1_P1));
PolarisPolicyMappingManager.LoadPolicyMappingsResult emptySearch =
polarisMetaStoreManager.loadPoliciesOnEntity(polarisCallContext, N1_N2_T1);
Assertions.assertThat(emptySearch.getPolicyEntities()).isEmpty();
Expand Down

0 comments on commit ebfcb90

Please sign in to comment.