This repository has been archived by the owner on Nov 14, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Live Reloading the TimeLock Block, Part 2: TransactionManagers Plumbi…
…ng (#2622) * ServiceCreator.applyDynamic() * Propagate config through TMs * Json Serialization fixes * Some refactoring * lock/lock * Fixed checkstyle * CR comments part 1 * Switch to RPIH * add test * [no release notes] forthcoming in part 4 * checkstyle
- Loading branch information
1 parent
18d35b6
commit a953328
Showing
36 changed files
with
628 additions
and
130 deletions.
There are no files selected for viewing
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
49 changes: 49 additions & 0 deletions
49
atlasdb-config/src/main/java/com/palantir/atlasdb/config/ServerListConfigs.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,49 @@ | ||
/* | ||
* Copyright 2017 Palantir Technologies, Inc. All rights reserved. | ||
* | ||
* Licensed under the BSD-3 License (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://opensource.org/licenses/BSD-3-Clause | ||
* | ||
* 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.palantir.atlasdb.config; | ||
|
||
import java.util.Optional; | ||
import java.util.Set; | ||
import java.util.function.Supplier; | ||
import java.util.stream.Collectors; | ||
|
||
public final class ServerListConfigs { | ||
private ServerListConfigs() { | ||
// utilities | ||
} | ||
|
||
public static ServerListConfig parseInstallAndRuntimeConfigs(TimeLockClientConfig installClientConfig, | ||
Supplier<Optional<TimeLockRuntimeConfig>> runtimeConfig, | ||
String namespace) { | ||
ServerListConfig nonNamespacedConfig = runtimeConfig.get() | ||
.map(TimeLockRuntimeConfig::serversList) | ||
.orElse(installClientConfig.serversList()); | ||
return namespaceUris(nonNamespacedConfig, namespace); | ||
} | ||
|
||
public static ServerListConfig namespaceUris(ServerListConfig config, String namespace) { | ||
Set<String> serversWithNamespaces = config | ||
.servers() | ||
.stream() | ||
.map(serverAddress -> serverAddress.replaceAll("/$", "") + "/" + namespace) | ||
.collect(Collectors.toSet()); | ||
return ImmutableServerListConfig.builder() | ||
.from(config) | ||
.servers(serversWithNamespaces) | ||
.build(); | ||
} | ||
} |
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
29 changes: 29 additions & 0 deletions
29
atlasdb-config/src/main/java/com/palantir/atlasdb/config/TimeLockRuntimeConfig.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,29 @@ | ||
/* | ||
* Copyright 2017 Palantir Technologies, Inc. All rights reserved. | ||
* | ||
* Licensed under the BSD-3 License (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://opensource.org/licenses/BSD-3-Clause | ||
* | ||
* 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.palantir.atlasdb.config; | ||
|
||
import org.immutables.value.Value; | ||
|
||
import com.fasterxml.jackson.databind.annotation.JsonDeserialize; | ||
import com.fasterxml.jackson.databind.annotation.JsonSerialize; | ||
|
||
@JsonSerialize(as = ImmutableTimeLockRuntimeConfig.class) | ||
@JsonDeserialize(as = ImmutableTimeLockRuntimeConfig.class) | ||
@Value.Immutable | ||
public abstract class TimeLockRuntimeConfig { | ||
public abstract ServerListConfig serversList(); | ||
} |
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
Oops, something went wrong.