-
Notifications
You must be signed in to change notification settings - Fork 604
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
72 changed files
with
2,413 additions
and
49 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,6 +21,8 @@ __pycache__/ | |
*_pb2.py | ||
*_pb2_grpc.py | ||
*_pb2.pyi | ||
*.pb.h | ||
*.pb.cc | ||
|
||
# MacOS specific | ||
.DS_Store | ||
|
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
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
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,48 @@ | ||
#pragma once | ||
|
||
#include <ydb/core/base/events.h> | ||
#include <ydb/core/graph/protos/graph.pb.h> | ||
|
||
namespace NKikimr { | ||
namespace NGraph { | ||
|
||
struct TEvGraph { | ||
enum EEv { | ||
// requests | ||
EvSendMetrics = EventSpaceBegin(TKikimrEvents::ES_GRAPH), | ||
EvGetMetrics, | ||
EvMetricsResult, | ||
EvEnd | ||
}; | ||
|
||
static_assert(EvEnd < EventSpaceEnd(TKikimrEvents::ES_GRAPH), "expect EvEnd < EventSpaceEnd(TKikimrEvents::ES_GRAPH)"); | ||
|
||
struct TEvSendMetrics : TEventPB<TEvSendMetrics, NKikimrGraph::TEvSendMetrics, EvSendMetrics> { | ||
TEvSendMetrics() = default; | ||
|
||
TEvSendMetrics(const TString& name, double value) { | ||
NKikimrGraph::TMetric* metric = Record.AddMetrics(); | ||
metric->SetName(name); | ||
metric->SetValue(value); | ||
} | ||
}; | ||
|
||
struct TEvGetMetrics : TEventPB<TEvGetMetrics, NKikimrGraph::TEvGetMetrics, EvGetMetrics> { | ||
TEvGetMetrics() = default; | ||
|
||
TEvGetMetrics(const NKikimrGraph::TEvGetMetrics& request) | ||
: TEventPB<TEvGetMetrics, NKikimrGraph::TEvGetMetrics, EvGetMetrics>(request) | ||
{} | ||
}; | ||
|
||
struct TEvMetricsResult : TEventPB<TEvMetricsResult, NKikimrGraph::TEvMetricsResult, EvMetricsResult> { | ||
TEvMetricsResult() = default; | ||
|
||
TEvMetricsResult(NKikimrGraph::TEvMetricsResult&& result) | ||
: TEventPB<TEvMetricsResult, NKikimrGraph::TEvMetricsResult, EvMetricsResult>(std::move(result)) | ||
{} | ||
}; | ||
}; | ||
|
||
} // NGraph | ||
} // NKikimr |
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,18 @@ | ||
#pragma once | ||
|
||
#include <ydb/library/actors/core/actor.h> | ||
|
||
namespace NKikimr { | ||
namespace NGraph { | ||
|
||
using namespace NActors; | ||
|
||
inline TActorId MakeGraphServiceId(ui32 node = 0) { | ||
char x[12] = {'g','r','a','p','h','s', 'v', 'c'}; | ||
return TActorId(node, TStringBuf(x, 12)); | ||
} | ||
|
||
IActor* CreateGraphService(const TString& database); | ||
|
||
} // NGraph | ||
} // NKikimr |
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,14 @@ | ||
#pragma once | ||
|
||
#include <ydb/library/actors/core/actor.h> | ||
#include <ydb/core/base/blobstorage.h> | ||
|
||
namespace NKikimr { | ||
namespace NGraph { | ||
|
||
using namespace NActors; | ||
|
||
IActor* CreateGraphShard(const TActorId& tablet, TTabletStorageInfo* info); | ||
|
||
} // NGraph | ||
} // NKikimr |
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,18 @@ | ||
LIBRARY() | ||
|
||
OWNER( | ||
xenoxeno | ||
g:kikimr | ||
) | ||
|
||
SRCS( | ||
events.h | ||
service.h | ||
shard.h | ||
) | ||
|
||
PEERDIR( | ||
ydb/core/graph/protos | ||
) | ||
|
||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
syntax = "proto3"; | ||
|
||
package NKikimrGraph; | ||
|
||
option java_package = "ru.yandex.kikimr.proto"; | ||
|
||
message TMetric { | ||
string Name = 1; | ||
double Value = 2; | ||
} | ||
|
||
message TEvSendMetrics { | ||
repeated TMetric Metrics = 1; | ||
} | ||
|
||
message TEvGetMetrics { | ||
optional uint64 TimeFrom = 1; | ||
optional uint64 TimeTo = 2; | ||
repeated string Metrics = 3; | ||
optional uint32 MaxPoints = 4; | ||
} | ||
|
||
message TMetricData { | ||
repeated double Values = 1 [packed = true]; | ||
} | ||
|
||
message TEvMetricsResult { | ||
repeated uint64 Time = 1 [packed = true]; | ||
repeated TMetricData Data = 2; | ||
string Error = 3; | ||
} |
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,14 @@ | ||
PROTO_LIBRARY() | ||
|
||
OWNER( | ||
xenoxeno | ||
g:kikimr | ||
) | ||
|
||
SRCS( | ||
graph.proto | ||
) | ||
|
||
EXCLUDE_TAGS(GO_PROTO) | ||
|
||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#pragma once | ||
|
||
#if defined BLOG_D || defined BLOG_I || defined BLOG_ERROR || defined BLOG_TRACE | ||
#error log macro definition clash | ||
#endif | ||
|
||
#include <util/generic/string.h> | ||
#include <ydb/library/actors/core/log.h> | ||
|
||
namespace NKikimr { | ||
namespace NGraph { | ||
|
||
TString GetLogPrefix(); | ||
|
||
} | ||
} | ||
|
||
#define BLOG_D(stream) ALOG_DEBUG(NKikimrServices::GRAPH, GetLogPrefix() << stream) | ||
#define BLOG_I(stream) ALOG_INFO(NKikimrServices::GRAPH, GetLogPrefix() << stream) | ||
#define BLOG_W(stream) ALOG_WARN(NKikimrServices::GRAPH, GetLogPrefix() << stream) | ||
#define BLOG_NOTICE(stream) ALOG_NOTICE(NKikimrServices::GRAPH, GetLogPrefix() << stream) | ||
#define BLOG_ERROR(stream) ALOG_ERROR(NKikimrServices::GRAPH, GetLogPrefix() << stream) | ||
#define BLOG_CRIT(stream) ALOG_CRIT(NKikimrServices::GRAPH, GetLogPrefix() << stream) | ||
#define BLOG_TRACE(stream) ALOG_TRACE(NKikimrServices::GRAPH, GetLogPrefix() << stream) | ||
#define Y_ENSURE_LOG(cond, stream) if (!(cond)) { BLOG_ERROR("Failed condition \"" << #cond << "\" " << stream); } |
Oops, something went wrong.