Skip to content

Commit c4a9c44

Browse files
author
Yufei Gu
committed
Fix copyOf used by the taskHanlder
1 parent 226789c commit c4a9c44

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

polaris-core/src/main/java/org/apache/polaris/core/PolarisCallContext.java

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -90,14 +90,6 @@ public PolarisCallContext(
9090
this.clock = Clock.system(ZoneId.systemDefault());
9191
}
9292

93-
public static PolarisCallContext copyOf(PolarisCallContext original) {
94-
return new PolarisCallContext(
95-
original.getMetaStore().detach(),
96-
original.getDiagServices(),
97-
original.getConfigurationStore(),
98-
original.getClock());
99-
}
100-
10193
public BasePersistence getMetaStore() {
10294
return metaStore;
10395
}

polaris-core/src/main/java/org/apache/polaris/core/context/CallContext.java

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,15 @@ public PolarisCallContext getPolarisCallContext() {
6969
static CallContext copyOf(CallContext base) {
7070
String realmId = base.getRealmContext().getRealmIdentifier();
7171
RealmContext realmContext = () -> realmId;
72-
PolarisCallContext polarisCallContext = PolarisCallContext.copyOf(base.getPolarisCallContext());
72+
PolarisCallContext originalPolarisCallContext = base.getPolarisCallContext();
73+
PolarisCallContext newPolarisCallContext =
74+
new PolarisCallContext(
75+
realmContext,
76+
originalPolarisCallContext.getMetaStore(),
77+
originalPolarisCallContext.getDiagServices(),
78+
originalPolarisCallContext.getConfigurationStore(),
79+
originalPolarisCallContext.getClock());
80+
7381
return new CallContext() {
7482
@Override
7583
public RealmContext getRealmContext() {
@@ -78,7 +86,7 @@ public RealmContext getRealmContext() {
7886

7987
@Override
8088
public PolarisCallContext getPolarisCallContext() {
81-
return polarisCallContext;
89+
return newPolarisCallContext;
8290
}
8391
};
8492
}

0 commit comments

Comments
 (0)