Skip to content

Commit

Permalink
[CARBONDATA-3095] Optimize the documentation of SDK/CSDK
Browse files Browse the repository at this point in the history
update the doc

update doc
  • Loading branch information
xubo245 committed Nov 22, 2018
1 parent 0b83a81 commit d51df14
Show file tree
Hide file tree
Showing 5 changed files with 147 additions and 52 deletions.
101 changes: 93 additions & 8 deletions docs/csdk-guide.md
Expand Up @@ -53,7 +53,20 @@ C++ SDK support read batch row. User can set batch by using withBatch(int batch)
* @return CarbonReaderBuilder object
*/
jobject builder(JNIEnv *env, char *path, char *tableName);
```

```
/**
* create a CarbonReaderBuilder object for building carbonReader,
* CarbonReaderBuilder object can configure different parameter
*
* @param env JNIEnv
* @param path data store path
* */
void builder(JNIEnv *env, char *path);
```

```
/**
* Configure the projection column names of carbon reader
*
Expand All @@ -62,7 +75,9 @@ C++ SDK support read batch row. User can set batch by using withBatch(int batch)
* @return CarbonReaderBuilder object
*/
jobject projection(int argc, char *argv[]);
```

```
/**
* build carbon reader with argument vector
* it support multiple parameter
Expand All @@ -74,50 +89,68 @@ C++ SDK support read batch row. User can set batch by using withBatch(int batch)
* @return CarbonReaderBuilder object
**/
jobject withHadoopConf(int argc, char *argv[]);
```

```
/**
* set batch size
* Sets the batch size of records to read
*
* @param batch batch size
* @return CarbonReaderBuilder object
*/
void withBatch(int batch);
```

```
/**
* Configure Row Record Reader for reading.
*/
void withRowRecordReader();
```

```
/**
* build carbonReader object for reading data
* it support read data from load disk
*
* @return carbonReader object
*/
jobject build();
```

```
/**
* Whether it has next row data
*
* @return boolean value, if it has next row, return true. if it hasn't next row, return false.
*/
jboolean hasNext();
```

```
/**
* read next carbonRow from data
* @return carbonRow object of one row
*/
jobject readNextRow();
```

```
/**
* read Next Batch Row
*
* @return rows
*/
jobjectArray readNextBatchRow();
```

```
/**
* close the carbon reader
*
* @return boolean value
*/
jboolean close();
```

# C++ SDK Writer
Expand Down Expand Up @@ -148,6 +181,7 @@ release the memory and destroy JVM.
*/
void builder(JNIEnv *env);
```

```
/**
* Sets the output path of the writer builder
Expand All @@ -158,6 +192,7 @@ release the memory and destroy JVM.
*/
void outputPath(char *path);
```

```
/**
* configure the schema with json style schema
Expand All @@ -167,22 +202,25 @@ release the memory and destroy JVM.
*/
void withCsvInput(char *jsonSchema);
```

```
/**
* configure parameter, including ak,sk and endpoint
* Updates the hadoop configuration with the given key value
*
* @param key key word
* @param value value
* @return CarbonWriterBuilder object
*/
void withHadoopConf(char *key, char *value);
```

```
/**
* @param appName appName which is writing the carbondata files
*/
void writtenBy(char *appName);
```

```
/**
* build carbonWriter object for writing data
Expand All @@ -192,6 +230,7 @@ release the memory and destroy JVM.
*/
void build();
```

```
/**
* Write an object to the file, the format of the object depends on the
Expand All @@ -200,6 +239,7 @@ release the memory and destroy JVM.
*/
void write(jobject obj);
```

```
/**
* close the carbon Writer
Expand All @@ -217,6 +257,7 @@ release the memory and destroy JVM.
*/
CarbonSchemaReader(JNIEnv *env);
```

```
/**
* read schema from path,
Expand All @@ -228,6 +269,7 @@ release the memory and destroy JVM.
*/
jobject readSchema(char *path);
```

```
/**
* read schema from path,
Expand All @@ -250,17 +292,17 @@ release the memory and destroy JVM.
* @param schema carbon schema data
*/
Schema(JNIEnv *env, jobject schema);
```

```
/**
* get fields length of schema
*
* @return fields length
*/
int getFieldsLength();
```

```
/**
* get field name by ordinal
Expand All @@ -269,8 +311,8 @@ release the memory and destroy JVM.
* @return ordinal field name
*/
char *getFieldName(int ordinal);
```

```
/**
* get field data type name by ordinal
Expand All @@ -279,8 +321,8 @@ release the memory and destroy JVM.
* @return ordinal field data type name
*/
char *getFieldDataTypeName(int ordinal);
```

```
/**
* get array child element data type name by ordinal
Expand All @@ -289,4 +331,47 @@ release the memory and destroy JVM.
* @return ordinal array child element data type name
*/
char *getArrayElementTypeName(int ordinal);
```
```

###CarbonProperties
```
/**
* Constructor of CarbonProperties
*
* @param env JNI env
*/
CarbonProperties(JNIEnv *env);
```

```
/**
* This method will be used to add a new property
*
* @param key property key
* @param value property value
* @return CarbonProperties object
*/
jobject addProperty(char *key, char *value);
```

```
/**
* This method will be used to get the properties value
*
* @param key property key
* @return property value
*/
char *getProperty(char *key);
```

```
/**
* This method will be used to get the properties value
* if property is not present then it will return the default value
*
* @param key property key
* @param defaultValue property default Value
* @return
*/
char *getProperty(char *key, char *defaultValue);
```

0 comments on commit d51df14

Please sign in to comment.