-
Notifications
You must be signed in to change notification settings - Fork 156
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Differential Revision: D44617759 fbshipit-source-id: c7da953c7a7b9fbe43ff866c7fca457539b91203
- Loading branch information
1 parent
9516d0c
commit ae775ef
Showing
2 changed files
with
91 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/* | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
#include "fbpcs/pc_translator/PCTranslator.h" | ||
|
||
namespace pc_translator { | ||
|
||
std::string PCTranslator::encode(const std::string& /* inputDataset */) { | ||
throw std::runtime_error("Unimplemented"); | ||
} | ||
|
||
std::string PCTranslator::decode( | ||
const std::string& /* aggregatedOutputDataset */) { | ||
throw std::runtime_error("Unimplemented"); | ||
} | ||
|
||
void PCTranslator::retrieveInstructionSets( | ||
std::vector<std::string>& /* instructionSetNames */) { | ||
throw std::runtime_error("Unimplemented"); | ||
} | ||
|
||
std::vector<std::string> PCTranslator::retrieveInstructionSetNamesForRun( | ||
const std::string& /* pcsFeatures */) { | ||
throw std::runtime_error("Unimplemented"); | ||
} | ||
|
||
void PCTranslator::transformDataset(const std::string& /* input */) { | ||
throw std::runtime_error("Unimplemented"); | ||
} | ||
|
||
void PCTranslator::parseInstructionSet( | ||
const std::string& /* instructionSet */) { | ||
throw std::runtime_error("Unimplemented"); | ||
} | ||
} // namespace pc_translator |
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,52 @@ | ||
/* | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include <cstdint> | ||
#include <memory> | ||
#include <string> | ||
#include <vector> | ||
|
||
namespace pc_translator { | ||
|
||
/* | ||
* This class contains functions required for PC Translator during actual run | ||
* i.e. retrieving the PC instruction sets, filtering the set per active GK for | ||
* run, encoding and decoding the dataset files input as per the instruction | ||
* set. | ||
*/ | ||
class PCTranslator { | ||
public: | ||
explicit PCTranslator(const std::string& pcsFeatures) | ||
: pcsfeatures_(pcsFeatures) {} | ||
|
||
/* | ||
* Method to encode the configurable fields in input dataset as per the active | ||
* pc instruction sets for the run. This method will output the path of | ||
* transformed input dataset, which can be used in further PC run. | ||
*/ | ||
std::string encode(const std::string& inputDataset); | ||
|
||
/* | ||
* Method to decode final aggregated output with the encoded breakdown Ids as | ||
* the keys. This method will decode the breakdown Ids to original group Id | ||
* values and format the aggregated output as per the new keys. Output of this | ||
* method would be the path of the decoded aggregated output. | ||
*/ | ||
std::string decode(const std::string& aggregatedOutputDataset); | ||
|
||
private: | ||
std::string pcsfeatures_; | ||
void retrieveInstructionSets(std::vector<std::string>& instructionSetNames); | ||
std::vector<std::string> retrieveInstructionSetNamesForRun( | ||
const std::string& pcsfeatures); | ||
void parseInstructionSet(const std::string& instructionSet); | ||
void transformDataset(const std::string& input); | ||
}; | ||
|
||
} // namespace pc_translator |