-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[BugFix] avoid hudi context npe when cache reload in background (#50987)
Signed-off-by: yanz <[email protected]> (cherry picked from commit 7e9eb06) # Conflicts: # fe/fe-core/src/main/java/com/starrocks/connector/RemoteFileScanContext.java # fe/fe-core/src/main/java/com/starrocks/connector/RemotePathKey.java # fe/fe-core/src/main/java/com/starrocks/connector/hudi/HudiRemoteFileIO.java # fe/fe-core/src/test/java/com/starrocks/connector/RemoteFileOperationsTest.java
- Loading branch information
1 parent
fa22ef6
commit 9bb3eca
Showing
4 changed files
with
192 additions
and
0 deletions.
There are no files selected for viewing
48 changes: 48 additions & 0 deletions
48
fe/fe-core/src/main/java/com/starrocks/connector/RemoteFileScanContext.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
// Copyright 2021-present StarRocks, Inc. All rights reserved. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// https://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
package com.starrocks.connector; | ||
|
||
import com.starrocks.catalog.Table; | ||
import org.apache.hudi.common.table.timeline.HoodieInstant; | ||
import org.apache.hudi.common.table.timeline.HoodieTimeline; | ||
import org.apache.hudi.common.table.view.HoodieTableFileSystemView; | ||
|
||
import java.util.concurrent.atomic.AtomicBoolean; | ||
import java.util.concurrent.locks.ReentrantLock; | ||
|
||
/* | ||
When doing concurrent loading remote files, some variables can be shared and reused to save costs. | ||
And in this context, we maintain fields can be shared and reused. | ||
*/ | ||
public class RemoteFileScanContext { | ||
public RemoteFileScanContext(Table table) { | ||
this.tableLocation = table.getTableLocation(); | ||
} | ||
|
||
public RemoteFileScanContext(String tableLocation) { | ||
this.tableLocation = tableLocation; | ||
} | ||
|
||
public String tableLocation = null; | ||
|
||
// ---- concurrent initialization ----- | ||
public AtomicBoolean init = new AtomicBoolean(false); | ||
public ReentrantLock lock = new ReentrantLock(); | ||
|
||
// ---- hudi related fields ----- | ||
public HoodieTableFileSystemView hudiFsView = null; | ||
public HoodieTimeline hudiTimeline = null; | ||
public HoodieInstant hudiLastInstant = null; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters