-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* update version match (#156) * fix config type convert bug for item with default null value (#164) * add import status and records count (#162) * add import status and records count * update test * support job parallelism for both tags and edges (#165) * support to get template config file according to the datasource (#170) * save the failed request before quit due to tooManyError (#172) * compute the vertex/edge amount from ngql (#169) * do not repartition when source dataframe has the same partition number with write partition config (#173) * add graph address for latency info (#175) * add graph address for latency info * add qps log * update version to 3.6.1
- Loading branch information
Showing
41 changed files
with
1,992 additions
and
460 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
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
67 changes: 67 additions & 0 deletions
67
exchange-common/src/main/java/com/vesoft/exchange/common/FileMigrate.java
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,67 @@ | ||
/* Copyright (c) 2023 vesoft inc. All rights reserved. | ||
* | ||
* This source code is licensed under Apache 2.0 License. | ||
*/ | ||
|
||
package com.vesoft.exchange.common; | ||
|
||
import java.io.BufferedReader; | ||
import java.io.BufferedWriter; | ||
import java.io.File; | ||
import java.io.FileWriter; | ||
import java.io.IOException; | ||
import java.io.InputStream; | ||
import java.io.InputStreamReader; | ||
|
||
public class FileMigrate { | ||
//Logger log = Logger.getLogger(FileMigrate.class); | ||
|
||
|
||
/** | ||
* migrate the source file to target path | ||
* | ||
* @param sourceFile template config file | ||
* @param path target path to save the config info | ||
*/ | ||
public void saveConfig(String sourceFile, String path) { | ||
InputStream inputStream = | ||
this.getClass().getClassLoader().getResourceAsStream(sourceFile); | ||
if (inputStream == null) { | ||
System.exit(-1); | ||
} | ||
File file = new File(path); | ||
if (file.exists()) { | ||
file.delete(); | ||
} | ||
FileWriter writer = null; | ||
BufferedWriter bufferedWriter = null; | ||
BufferedReader reader = null; | ||
try { | ||
writer = new FileWriter(path); | ||
bufferedWriter = new BufferedWriter(writer); | ||
|
||
reader = new BufferedReader(new InputStreamReader(inputStream)); | ||
String line = null; | ||
while ((line = reader.readLine()) != null) { | ||
bufferedWriter.write(line); | ||
bufferedWriter.write("\n"); | ||
} | ||
} catch (IOException e) { | ||
System.out.println("Failed to migrate the template conf file:" + e.getMessage()); | ||
e.printStackTrace(); | ||
} finally { | ||
try { | ||
if (bufferedWriter != null) { | ||
bufferedWriter.close(); | ||
} | ||
if (reader != null) { | ||
reader.close(); | ||
} | ||
} catch (IOException e) { | ||
System.out.println("Failed to close the writer or reader:" + e.getMessage()); | ||
e.printStackTrace(); | ||
} | ||
} | ||
|
||
} | ||
} |
Oops, something went wrong.