Skip to content

Commit

Permalink
issue #324: cleanup: filesystem-id field is not needed for filestore-…
Browse files Browse the repository at this point in the history
…client executeaction, removed broken (and unneeded) json validation; fixed comments here and there, etc (#351)
  • Loading branch information
qkrorlqr committed Feb 6, 2024
1 parent 6105a56 commit 885e799
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 14 deletions.
8 changes: 2 additions & 6 deletions cloud/filestore/apps/client/lib/execute_action.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ TString ReadFile(const TString& path)
}

class TExecuteActionCommand final
: public TFileStoreCommand
: public TFileStoreServiceCommand
{
private:
TString Action;
Expand Down Expand Up @@ -51,10 +51,6 @@ class TExecuteActionCommand final

auto& input = Input.Empty() ? Cin : inputBytes;
auto inputJsonStr = input.ReadAll();
if (NJson::ValidateJson(inputJsonStr)) {
Cout << "Invalid input-json" << Endl;
return false;
}

STORAGE_DEBUG("Reading ExecuteAction request");
auto request = std::make_shared<NProto::TExecuteActionRequest>();
Expand All @@ -71,7 +67,7 @@ class TExecuteActionCommand final

if (HasError(result)) {
Cout << FormatError(result.GetError()) << Endl;
return false;
return true;
}

Cout << result.GetOutput() << Endl;
Expand Down
2 changes: 1 addition & 1 deletion cloud/filestore/config/storage.proto
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ message TStorageConfig
// flushing.
optional uint32 FlushThreshold = 10;

// Backpressure thresholds.
// Thresholds for background ops.
optional uint32 CleanupThreshold = 11;
optional uint32 CompactionThreshold = 12;
optional uint32 CollectGarbageThreshold = 13;
Expand Down
7 changes: 3 additions & 4 deletions cloud/filestore/libs/storage/core/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -224,17 +224,16 @@ void TStorageConfig::DumpHtml(IOutputStream& out) const

////////////////////////////////////////////////////////////////////////////////

void TStorageConfig::Merge(
const NProto::TStorageConfig& storageConfig)
void TStorageConfig::Merge(const NProto::TStorageConfig& storageConfig)
{
ProtoConfig.MergeFrom(storageConfig);
}

TStorageConfig::TValueByName TStorageConfig::GetValueByName(
const TString& name) const
{
auto descriptor =
ProtoConfig.GetDescriptor()->FindFieldByName(name);
const auto* descriptor =
NProto::TStorageConfig::GetDescriptor()->FindFieldByName(name);
using TStatus = TValueByName::ENameStatus;

if (descriptor == nullptr) {
Expand Down
2 changes: 1 addition & 1 deletion cloud/filestore/libs/storage/core/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class TStorageConfig

TStorageConfig(const TStorageConfig&) = default;

void Merge(const NProto::TStorageConfig& storageServiceConfig);
void Merge(const NProto::TStorageConfig& storageConfig);

TValueByName GetValueByName(const TString& name) const;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ void TIndexTabletActor::ExecuteTx_ChangeStorageConfig(
{
TIndexTabletDatabase db(tx.DB);
if (args.StorageConfigFromDB.Defined()) {
auto config = args.StorageConfigFromDB.Get();
auto* config = args.StorageConfigFromDB.Get();
config->MergeFrom(args.StorageConfigNew);
db.WriteStorageConfig(*config);
args.ResultStorageConfig = std::move(*config);
Expand Down
2 changes: 1 addition & 1 deletion cloud/filestore/private/api/protos/actions.proto
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ package NCloud.NFileStore.NProtoPrivate;
option go_package = "github.com/ydb-platform/nbs/cloud/filestore/private/api/protos";

////////////////////////////////////////////////////////////////////////////////
// Actiions
// Actions

message TDrainNodeRequest
{
Expand Down

0 comments on commit 885e799

Please sign in to comment.