-
Notifications
You must be signed in to change notification settings - Fork 610
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'ydb-platform:main' into YQ-2356.connector_integration_t…
…ests
- Loading branch information
Showing
28 changed files
with
558 additions
and
114 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
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 @@ | ||
#include "guc_settings.h" | ||
|
||
void TGUCSettings::Setup(const std::unordered_map<std::string, std::string>& runtimeSettings) { | ||
RollbackSettings_ = runtimeSettings; | ||
RollBack(); | ||
} | ||
|
||
std::optional<std::string> TGUCSettings::Get(const std::string& key) const { | ||
auto it = Settings_.find(key); | ||
if (it == Settings_.end()) { | ||
return std::nullopt; | ||
} | ||
return it->second; | ||
} | ||
|
||
void TGUCSettings::Set(const std::string& key, const std::string& val, bool isLocal) { | ||
Settings_[key] = val; | ||
if (!isLocal) { | ||
SessionSettings_[key] = val; | ||
} | ||
} | ||
|
||
void TGUCSettings::Commit() { | ||
RollbackSettings_ = SessionSettings_; | ||
} | ||
|
||
void TGUCSettings::RollBack() { | ||
Settings_ = SessionSettings_ = RollbackSettings_; | ||
} |
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,20 @@ | ||
#pragma once | ||
#include <unordered_map> | ||
#include <vector> | ||
#include <string> | ||
#include <optional> | ||
#include <memory> | ||
|
||
class TGUCSettings { | ||
public: | ||
using TPtr = std::shared_ptr<TGUCSettings>; | ||
void Setup(const std::unordered_map<std::string, std::string>& runtimeSettings); | ||
std::optional<std::string> Get(const std::string&) const; | ||
void Set(const std::string&, const std::string&, bool isLocal = false); | ||
void Commit(); | ||
void RollBack(); | ||
private: | ||
std::unordered_map<std::string, std::string> Settings_; | ||
std::unordered_map<std::string, std::string> RollbackSettings_; | ||
std::unordered_map<std::string, std::string> SessionSettings_; | ||
}; |
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,7 @@ | ||
LIBRARY() | ||
|
||
SRCS( | ||
guc_settings.cpp | ||
) | ||
|
||
END() |
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
22 changes: 22 additions & 0 deletions
22
ydb/library/yql/providers/generic/connector/tests/utils/docker_compose.py
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,22 @@ | ||
import os | ||
import subprocess | ||
|
||
import yatest.common | ||
|
||
|
||
class EndpointDeterminer: | ||
docker_compose_bin: os.PathLike | ||
docker_compose_yml: os.PathLike | ||
|
||
def __init__(self, docker_compose_yml: os.PathLike): | ||
self.docker_compose_bin = yatest.common.build_path('library/recipes/docker_compose/bin/docker-compose') | ||
self.docker_compose_yml = docker_compose_yml | ||
|
||
def get_port(self, service_name: str, internal_port: int) -> int: | ||
cmd = [self.docker_compose_bin, '-f', self.docker_compose_yml, 'port', service_name, str(internal_port)] | ||
try: | ||
out = subprocess.check_output(cmd, stderr=subprocess.STDOUT) | ||
external_port = int(out.split(b':')[1]) | ||
return external_port | ||
except subprocess.CalledProcessError as e: | ||
raise RuntimeError(f"docker-compose error: {e.output} (code {e.returncode})") |
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
Oops, something went wrong.