-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add new api to upload csv, table.yaml, and query into HDFS #48
base: dev
Are you sure you want to change the base?
Conversation
NLGithubWP
commented
May 29, 2022
•
edited
Loading
edited
- Enable provide .dz file name in the loading process.
- Add distributed APIs to enable users to load local CSV and upload it to HDFS.
- Add distributed APIs to enable users to upload queries.json files, store them locally, and upload them into HDFS.
- Add comments.
- Add Client Package to send reqeust.
- docs is at Add distributed APIs into doc COOL-site#23
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs to change many things
@@ -9,7 +9,7 @@ | |||
public class CliDataWriter implements DataWriter { | |||
|
|||
@Override | |||
public boolean Initialize() throws IOException { | |||
public boolean Initialize(String... fileName) throws IOException { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use String[] instead of the String...
@@ -137,8 +137,15 @@ private void finishCublet() throws IOException { | |||
* @return DataOutputStream | |||
* @throws IOException | |||
*/ | |||
private DataOutputStream newCublet() throws IOException { | |||
String fileName = Long.toHexString(System.currentTimeMillis()) + ".dz"; | |||
private DataOutputStream newCublet(String... fileNameParams) throws IOException { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do we need to give a file name?
@@ -33,6 +33,10 @@ public class LoadQuery { | |||
private String outputPath; | |||
private String configPath; | |||
|
|||
// after writing dz, table file, records the path inside the server. | |||
private String dzFilePath; | |||
private String TableFilePath; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TableFilePath should be the same as the schemaPath.
@@ -33,6 +33,10 @@ public class LoadQuery { | |||
private String outputPath; | |||
private String configPath; | |||
|
|||
// after writing dz, table file, records the path inside the server. | |||
private String dzFilePath; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need the dzFilePath?
* @param dataSourceName output cube name. Need to be specified when loading from the repository, eg, sogamo | ||
* @param schemaFileName path to the table.yaml, eg. sogamo/table.yaml | ||
* @param dataFileName path to the data.csv, eg. sogamo/test.csv | ||
* @param cubeRepo the name of the output cube repository. eg. datasetSource |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It needs a @param for fileName
public static void main(String[] args) throws Exception { | ||
|
||
if (args.length != 1) { | ||
System.err.println("Pass in query id (Example: q1)"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is hard coding.
HDFSConnection fs = HDFSConnection.getInstance(); | ||
|
||
String localPath1 = req.getOutputPath() + "/" + req.getDzFilePath();; | ||
String dfsPath1 = "/cube/" + req.getDzFilePath(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cube
path is for ?