Skip to content
This repository has been archived by the owner on Nov 14, 2024. It is now read-only.

[QoS] Feature/qos client #2650

Merged
merged 9 commits into from
Nov 10, 2017
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions atlasdb-api/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ dependencies {
compile group: 'javax.validation', name: 'validation-api'

compile group: 'com.palantir.remoting-api', name: 'ssl-config'
compile group: 'com.palantir.remoting3', name: 'jaxrs-clients'

processor group: 'org.immutables', name: 'value'

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*
* 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.keyvalue.api;

import java.util.Optional;

import org.immutables.value.Value;

import com.palantir.remoting.api.config.service.ServiceConfiguration;

@Value.Immutable
public abstract class QosClientBuilder {
public abstract Optional<ServiceConfiguration> qosServiceConfiguration();

@Value.Default
public String qosUserAgent() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be the same user agent we use for timelock (the one passed to the txn manager builder)

return "unknown-qos-agent";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@
import org.slf4j.LoggerFactory;

import com.palantir.atlasdb.config.LeaderConfig;
import com.palantir.atlasdb.keyvalue.api.ImmutableQosClientBuilder;
import com.palantir.atlasdb.keyvalue.api.KeyValueService;
import com.palantir.atlasdb.keyvalue.api.QosClientBuilder;
import com.palantir.atlasdb.keyvalue.api.TableReference;
import com.palantir.timestamp.TimestampService;
import com.palantir.timestamp.TimestampStoreInvalidator;
Expand All @@ -34,7 +36,8 @@ public interface AtlasDbFactory {

default KeyValueService createRawKeyValueService(
KeyValueServiceConfig config, Optional<LeaderConfig> leaderConfig) {
return createRawKeyValueService(config, leaderConfig, Optional.empty(), DEFAULT_INITIALIZE_ASYNC);
return createRawKeyValueService(config, leaderConfig, Optional.empty(), DEFAULT_INITIALIZE_ASYNC,
ImmutableQosClientBuilder.builder().build());
}

/**
Expand All @@ -52,7 +55,8 @@ KeyValueService createRawKeyValueService(
KeyValueServiceConfig config,
Optional<LeaderConfig> leaderConfig,
Optional<String> namespace,
boolean initializeAsync);
boolean initializeAsync,
QosClientBuilder qosClientBuilder);

default TimestampService createTimestampService(KeyValueService rawKvs) {
return createTimestampService(rawKvs, Optional.empty(), DEFAULT_INITIALIZE_ASYNC);
Expand Down
Loading