Skip to content
Closed
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 @@
33
34
2 changes: 1 addition & 1 deletion .github/last_commit.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
303019a794dd98ca44a77440af08bbeecf56d727
060a9aa97e1c45608a90c5c39979ede58f0951fa
3 changes: 3 additions & 0 deletions include/ydb-cpp-sdk/client/driver/driver.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ class TDriverConfig {
//! client will connect to others nodes according to client loadbalancing
TDriverConfig& SetEndpoint(const std::string& endpoint);

//! Get endpoint, returns the endpoint set via connection string or SetEndpoint()
const std::string& GetEndpoint() const;

//! Set number of network threads, default: 2
TDriverConfig& SetNetworkThreadsNum(size_t sz);

Expand Down
1 change: 1 addition & 0 deletions include/ydb-cpp-sdk/client/scheme/scheme.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ enum class ESchemeEntryType : i32 {
SysView = 22,
Transfer = 23,
StreamingQuery = 24,
BackupCollection = 25,
};

struct TVirtualTimestamp {
Expand Down
3 changes: 2 additions & 1 deletion include/ydb-cpp-sdk/client/table/table_enum.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ enum class EIndexType {
GlobalAsync,
GlobalUnique,
GlobalVectorKMeansTree,
GlobalFulltext,
GlobalFulltextPlain,
GlobalFulltextRelevance,

Unknown = std::numeric_limits<int>::max()
};
Expand Down
23 changes: 19 additions & 4 deletions include/ydb-cpp-sdk/client/topic/read_events.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,21 @@ struct TPartitionSession: public TThrRefBase, public TPrintable<TPartitionSessio
template<>
void TPrintable<TPartitionSession>::DebugString(TStringBuilder& res, bool) const;

struct TPartitionSessionControl: public TPartitionSession {
//! Commit offsets range.
//! Can be used from TDataReceivedEvent or TDeferredCommit.
virtual void Commit(uint64_t startOffset, uint64_t endOffset) = 0;

//! Confirm partition session creation from TStartPartitionSessionEvent.
virtual void ConfirmCreate(std::optional<uint64_t> readOffset, std::optional<uint64_t> commitOffset) = 0;

//! Confirm partition session destruction from TStopPartitionSessionEvent.
virtual void ConfirmDestroy() = 0;

//! Confirm partition session end from TEndPartitionSessionEvent.
virtual void ConfirmEnd(std::span<const uint32_t> childIds) = 0;
};

//! Events for read session.
struct TReadSessionEvent {
class TPartitionSessionAccessor {
Expand All @@ -73,7 +88,7 @@ struct TReadSessionEvent {

//! Event with new data.
//! Contains batch of messages from single partition session.
struct TDataReceivedEvent : public TPartitionSessionAccessor, public TPrintable<TDataReceivedEvent> {
struct TDataReceivedEvent: public TPartitionSessionAccessor, public TPrintable<TDataReceivedEvent> {
struct TMessageInformation {
TMessageInformation(uint64_t offset,
std::string producerId,
Expand All @@ -95,7 +110,7 @@ struct TReadSessionEvent {
std::string MessageGroupId;
};

class TMessageBase : public TPrintable<TMessageBase> {
class TMessageBase: public TPrintable<TMessageBase> {
public:
TMessageBase(const std::string& data, TMessageInformation info);

Expand Down Expand Up @@ -249,7 +264,7 @@ struct TReadSessionEvent {
//! This means that from now the first available
//! message offset in current partition
//! for current consumer is this offset.
//! All messages before are committed and futher never be available.
//! All messages before are committed and further never be available.
uint64_t GetCommittedOffset() const {
return CommittedOffset;
}
Expand Down Expand Up @@ -452,4 +467,4 @@ void TPrintable<TSessionClosedEvent>::DebugString(TStringBuilder& ret, bool prin

std::string DebugString(const TReadSessionEvent::TEvent& event);

}
} // namespace NYdb::NTopic
4 changes: 2 additions & 2 deletions include/ydb-cpp-sdk/client/topic/read_session.h
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,8 @@ struct TReadSessionSettings: public TRequestSettings<TReadSessionSettings> {
//! AutoPartitioningSupport.
FLUENT_SETTING_DEFAULT(bool, AutoPartitioningSupport, false);

// TODO(qyryq) Uncomment when direct read is ready.
// FLUENT_SETTING_DEFAULT(bool, DirectRead, false);
//! Direct read from partition nodes. Experimental setting — not recommended for use.
FLUENT_SETTING_DEFAULT(bool, DirectRead, false);

//! Log.
FLUENT_SETTING_OPTIONAL(TLog, Log);
Expand Down
6 changes: 3 additions & 3 deletions include/ydb-cpp-sdk/client/topic/write_session.h
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ class ISimpleBlockingWriteSession : public TThrRefBase {

virtual bool Close(TDuration closeTimeout = TDuration::Max()) = 0;

//! Returns true if write session is alive and acitve. False if session was closed.
//! Returns true if write session is alive and active. False if session was closed.
virtual bool IsAlive() const = 0;

virtual TWriterCounters::TPtr GetCounters() = 0;
Expand Down Expand Up @@ -269,11 +269,11 @@ class IWriteSession {
//! Return true if all writes were completed and acked, false if timeout was reached and some writes were aborted.
virtual bool Close(TDuration closeTimeout = TDuration::Max()) = 0;

//! Writer counters with different stats (see TWriterConuters).
//! Writer counters with different stats (see TWriterCounters).
virtual TWriterCounters::TPtr GetCounters() = 0;

//! Close() with timeout = 0 and destroy everything instantly.
virtual ~IWriteSession() = default;
};

}
} // namespace NYdb::NTopic
30 changes: 30 additions & 0 deletions src/api/grpc/draft/ydb_nbs_v1.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
syntax = "proto3";

package Ydb.Nbs.V1;

option java_package = "com.yandex.ydb.nbs.v1";
option java_outer_classname = "NbsGrpc";
option java_multiple_files = true;

import "src/api/protos/draft/ydb_nbs.proto";

// Service for managing nbs 2.0
service NbsService {
// Create NBS partition
rpc CreatePartition(NYdb.NBS.NProto.CreatePartitionRequest) returns (NYdb.NBS.NProto.CreatePartitionResponse);

// Delete NBS partition
rpc DeletePartition(NYdb.NBS.NProto.DeletePartitionRequest) returns (NYdb.NBS.NProto.DeletePartitionResponse);

// List NBS partitions
rpc ListPartitions(NYdb.NBS.NProto.ListPartitionsRequest) returns (NYdb.NBS.NProto.ListPartitionsResponse);


//
// Block I/O.
//

rpc ReadBlocks(NYdb.NBS.NProto.ReadBlocksRequest) returns (NYdb.NBS.NProto.ReadBlocksResponse);

rpc WriteBlocks(NYdb.NBS.NProto.WriteBlocksRequest) returns (NYdb.NBS.NProto.WriteBlocksResponse);
}
99 changes: 99 additions & 0 deletions src/api/protos/draft/ydb_nbs.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
syntax = "proto3";
option cc_enable_arenas = true;

package NYdb.NBS.NProto;

option java_package = "com.yandex.ydb.nbs.proto";
option java_outer_classname = "NbsProtos";
option java_multiple_files = true;

import "ydb/core/nbs/cloud/blockstore/public/api/protos/io.proto";
import "src/api/protos/ydb_operation.proto";


////////////////////////////////////////////////////////////////////////////////
// Partition create request/response.

message CreatePartitionRequest {
Ydb.Operations.OperationParams operation_params = 1;

// Storage pool name to use.
string StoragePoolName = 2;

// Minimum addressable block size (smallest unit of I/O operations).
uint32 BlockSize = 3;

// Maximum number of blocks stored in partition.
uint64 BlocksCount = 4;
}

message CreatePartitionResponse {
Ydb.Operations.Operation operation = 1;
}

message CreatePartitionResult {
string TabletId = 1;
}

////////////////////////////////////////////////////////////////////////////////
// Partition delete request/response.

message DeletePartitionRequest {
Ydb.Operations.OperationParams operation_params = 1;
// Partition tablet id to delete.
string TabletId = 2;
}

message DeletePartitionResponse {
Ydb.Operations.Operation operation = 1;
}

message DeletePartitionResult {
// Deleted partition tablet id.
string TabletId = 1;
}

////////////////////////////////////////////////////////////////////////////////
// Partition list request/response.

message ListPartitionsRequest {
Ydb.Operations.OperationParams operation_params = 1;
}

message ListPartitionsResponse {
Ydb.Operations.Operation operation = 1;
}

message ListPartitionsResult {
repeated string TabletId = 1;
}

////////////////////////////////////////////////////////////////////////////////
// Blocks read request/response.

message ReadBlocksRequest
{
Ydb.Operations.OperationParams operation_params = 1;

TReadBlocksRequest request = 2;
}

message ReadBlocksResponse
{
Ydb.Operations.Operation operation = 1;
}

////////////////////////////////////////////////////////////////////////////////
// Blocks write request/response.

message WriteBlocksRequest
{
Ydb.Operations.OperationParams operation_params = 1;

TWriteBlocksRequest request = 2;
}

message WriteBlocksResponse
{
Ydb.Operations.Operation operation = 1;
}
1 change: 1 addition & 0 deletions src/api/protos/ydb_scheme.proto
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ message Entry {
EXTERNAL_DATA_SOURCE = 19;
VIEW = 20;
RESOURCE_POOL = 21;
BACKUP_COLLECTION = 22;
TRANSFER = 23;
SYS_VIEW = 24;
STREAMING_QUERY = 26;
Expand Down
Loading
Loading