Repository navigation
Support database-scoped tablet insertion in table sessions #19237
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
shuwenwei
wants to merge
11
commits into
master
Choose a base branch
from
feature/table-session-db-insert
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+369
−47
Open
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
e5a2715
Add database-scoped tablet insertion for table sessions
shuwenwei 7ab0db7
Fix table model redirect cache across databases
shuwenwei e8a15c6
Fix missing table model device ID import
shuwenwei 2f49f14
Preserve ISession flat route cache API
shuwenwei b092a12
Expose database-aware session route cache open API
shuwenwei f53ab9a
Fix nested route cache test compilation
shuwenwei 88d429d
Validate and normalize table database routing
shuwenwei 44ae923
Merge branch 'iotdb_master' into feature/table-session-db-insert
shuwenwei cfabbfb
Share table database name validation
shuwenwei ba47a19
Negotiate database-scoped tablet support
shuwenwei 69eda01
spotless
shuwenwei File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
38 changes: 38 additions & 0 deletions
38
...client/isession/src/main/java/org/apache/iotdb/isession/util/TableModelDatabaseUtils.java
This file contains hidden or 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,38 @@ | ||
| /* | ||
| * Licensed to the Apache Software Foundation (ASF) under one | ||
| * or more contributor license agreements. See the NOTICE file | ||
| * distributed with this work for additional information | ||
| * regarding copyright ownership. The ASF licenses this file | ||
| * to you 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 | ||
| * | ||
| * http://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 org.apache.iotdb.isession.util; | ||
|
|
||
| import java.util.regex.Pattern; | ||
|
|
||
| /** Utilities for table-model database names. */ | ||
| public final class TableModelDatabaseUtils { | ||
|
|
||
| private static final Pattern DATABASE_NAME_PATTERN = | ||
| Pattern.compile("([a-zA-Z0-9`_\\-\\u2E80-\\u9FFF]+)"); | ||
|
|
||
| private TableModelDatabaseUtils() {} | ||
|
|
||
| public static boolean isValidDatabaseName(String databaseName, int maxLength) { | ||
| return databaseName != null | ||
| && databaseName.length() <= maxLength | ||
| && databaseName.indexOf('.') < 0 | ||
| && DATABASE_NAME_PATTERN.matcher(databaseName).matches(); | ||
| } | ||
| } |
This file contains hidden or 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 hidden or 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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This adds an internal cache-sharing hook to
ISession, a public interface that users program against, and its nested-map parameter exposes the cache layout. The only callers are inSessionPool. The method has to be on the interface only becausegetSession()declaresISession session = queue.poll();. Opening the new connection through a localSessionwould avoid that:tryConstructNewSession()already uses aSession.Separately, the new abstract methods here and the new
ITableSession.insert(Tablet, String)break every third-party implementation of these interfaces at compile time.ISessionalready usesdefaultmethods for this kind of evolution (e.g.isEnableCacheLeader).insert(Tablet, String)could be adefaultmethod that delegates toinsert(tablet)whendatabase == nulland throwsUnsupportedOperationExceptionotherwise.