Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion .github/import_generation.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
48
49
2 changes: 1 addition & 1 deletion .github/last_commit.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
a7781966132cf3d3f84cc320cd002257c6220f5b
d4e67d2428cc0f9dd329065a3c38476fbd8b7592
4 changes: 2 additions & 2 deletions .github/workflows/slo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
if: contains(github.event.pull_request.labels.*.name, 'SLO')

name: Cache SLO SDK (${{ matrix.sdk.name }})
runs-on: ubuntu-latest
runs-on: large-runner-cpp-sdk
timeout-minutes: 90

strategy:
Expand Down Expand Up @@ -86,7 +86,7 @@ jobs:
needs: sdk-cache

name: Run YDB SLO Tests (${{ matrix.sdk.name }})
runs-on: ubuntu-latest
runs-on: large-runner-cpp-sdk
timeout-minutes: 120

strategy:
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
* Added `EQ_HEIGHT_HISTOGRAM` to `EMultiColumnStatisticsType`.

# v3.22.0

* Added `IWriteSession::Flush` to asynchronously wait until all previously accepted topic writes are acknowledged.
Expand Down
1 change: 1 addition & 0 deletions cmake/public_headers.txt
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ util/generic/array_ref.h
util/generic/bitops.h
util/generic/buffer.h
util/generic/cast.h
util/generic/constant_evaluation.h
util/generic/deque.h
util/generic/explicit_type.h
util/generic/flags.h
Expand Down
1 change: 1 addition & 0 deletions include/ydb-cpp-sdk/client/query/query.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ struct TExecuteQuerySettings : public TRequestSettings<TExecuteQuerySettings> {
FLUENT_SETTING_DEFAULT(ESyntax, Syntax, ESyntax::YqlV1);
FLUENT_SETTING_DEFAULT(EExecMode, ExecMode, EExecMode::Execute);
FLUENT_SETTING_DEFAULT(EStatsMode, StatsMode, EStatsMode::None);
FLUENT_SETTING_DEFAULT(bool, CollectAffectedRows, false);
FLUENT_SETTING_OPTIONAL(bool, ConcurrentResultSets);
FLUENT_SETTING(std::string, ResourcePool);
FLUENT_SETTING_OPTIONAL(std::chrono::milliseconds, StatsCollectPeriod);
Expand Down
2 changes: 2 additions & 0 deletions include/ydb-cpp-sdk/client/query/stats.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,15 @@ class TTableAccessStats {
const TOperationStats& GetUpdates() const;
const TOperationStats& GetDeletes() const;
uint64_t GetPartitionsCount() const;
std::optional<uint64_t> GetAffectedRows() const;

private:
std::string Name_;
TOperationStats Reads_;
TOperationStats Updates_;
TOperationStats Deletes_;
uint64_t PartitionsCount_ = 0;
std::optional<uint64_t> AffectedRows_;
};

class TQueryPhaseStats {
Expand Down
3 changes: 3 additions & 0 deletions include/ydb-cpp-sdk/client/table/table.h
Original file line number Diff line number Diff line change
Expand Up @@ -407,9 +407,11 @@ struct TFulltextIndexSettings {
std::optional<int32_t> FilterLengthMin;
std::optional<int32_t> FilterLengthMax;
std::optional<bool> UseFilterSnowball;
std::optional<bool> UseFilterSuperLemmer;

static TAnalyzers Standard();
static TAnalyzers Snowball(std::string language);
static TAnalyzers SuperLemmer(std::string language);
static TAnalyzers Keyword();
};

Expand Down Expand Up @@ -1044,6 +1046,7 @@ enum class EStoreType {
enum class EMultiColumnStatisticsType {
Unknown = 0,
CountMinSketch = 1,
EqHeightHistogram = 2,
};

//! Represents multi-column table statistics description
Expand Down
28 changes: 26 additions & 2 deletions library/cpp/http/io/stream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,12 @@ class THttpInput::TImpl {
typedef THashSet<TString> TAcceptCodings;

public:
inline TImpl(IInputStream* slave)
inline TImpl(IInputStream* slave, const THttpInput::TOptions& options = {})
: Slave_(slave)
, Options_(options)
, Buffered_(Slave_, SuggestBufferSize())
, ChunkedInput_(nullptr)
, LengthLimitedInput_(nullptr)
, Input_(nullptr)
, FirstLine_(ReadFirstLine(Buffered_))
, Headers_(&Buffered_)
Expand Down Expand Up @@ -208,12 +210,22 @@ class THttpInput::TImpl {
return Expect100Continue_;
}

inline ui64 ContentLengthLeft() const noexcept {
return LengthLimitedInput_ ? LengthLimitedInput_->Left() : 0;
}

private:
template <class Operation>
inline size_t Perform(size_t len, const Operation& operation) {
size_t processed = operation(len);
if (processed == 0 && len > 0) {
if (!ChunkedInput_) {
if (Options_.StrictContentLength) {
if (const ui64 left = ContentLengthLeft()) {
ythrow THttpTruncatedBodyException() << "Body ended after " << (ContentLength_ - left)
<< " of " << ContentLength_ << " byte(s) declared in Content-Length";
}
}
Trailers_.ConstructInPlace();
} else {
// Read the header of the trailing chunk. It remains in
Expand Down Expand Up @@ -345,7 +357,8 @@ class THttpInput::TImpl {
/*
* TODO - we have other cases
*/
Input_ = Streams_.Add(new TLengthLimitedInput(Input_, ContentLength_));
LengthLimitedInput_ = Streams_.Add(new TLengthLimitedInput(Input_, ContentLength_));
Input_ = LengthLimitedInput_;
}
}

Expand All @@ -359,13 +372,15 @@ class THttpInput::TImpl {

private:
IInputStream* Slave_;
THttpInput::TOptions Options_;

/*
* input helpers
*/
TBufferedInput Buffered_;
TStreams<IInputStream, 8> Streams_;
IInputStream* ChunkedInput_;
TLengthLimitedInput* LengthLimitedInput_;

/*
* final input stream
Expand All @@ -391,6 +406,11 @@ THttpInput::THttpInput(IInputStream* slave)
{
}

THttpInput::THttpInput(IInputStream* slave, const TOptions& options)
: Impl_(new TImpl(slave, options))
{
}

THttpInput::THttpInput(THttpInput&& httpInput) = default;

THttpInput::~THttpInput() {
Expand Down Expand Up @@ -445,6 +465,10 @@ bool THttpInput::ContentEncoded() const noexcept {
return Impl_->ContentEncoded();
}

ui64 THttpInput::ContentLengthLeft() const noexcept {
return Impl_->ContentLengthLeft();
}

bool THttpInput::HasContent() const noexcept {
return Impl_->HasContent();
}
Expand Down
19 changes: 19 additions & 0 deletions library/cpp/http/io/stream.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,24 @@ struct THttpParseException: public THttpException {
struct THttpReadException: public THttpException {
};

// Body ended before Content-Length. Thrown only under TOptions::StrictContentLength.
struct THttpTruncatedBodyException: public THttpReadException {
};

/// Чтение ответа HTTP-сервера.
class THttpInput: public IInputStream {
public:
struct TOptions {
// If Content-Length is present, throw THttpTruncatedBodyException once the underlying
// stream reaches EOF with fewer bytes read than announced. A caller that stops reading
// early and destroys the stream does not trigger it.
// Do not enable for HEAD responses: they announce Content-Length but carry no body,
// which is indistinguishable from truncation at this level.
bool StrictContentLength = false;
};

THttpInput(IInputStream* slave);
THttpInput(IInputStream* slave, const TOptions& options);
THttpInput(THttpInput&& httpInput);
~THttpInput() override;

Expand Down Expand Up @@ -81,6 +95,11 @@ class THttpInput: public IInputStream {
/// показывает объём запакованных данных, а из THttpInput мы будем вычитывать уже распакованные.
bool ContentEncoded() const noexcept;

/// Сколько байт из заявленных в Content-Length ещё не вычитано из тела (до распаковки).
/// Всегда 0, если Content-Length в ответе нет или используется chunked encoding.
/// После полного вычитывания тела ненулевое значение означает обрыв ответа.
ui64 ContentLengthLeft() const noexcept;

/// Returns true if Content-Length or Transfer-Encoding header received
bool HasContent() const noexcept;

Expand Down
Loading
Loading