Deleting the not needed commented out code

This commit is contained in:
Spyros Zoupanos 2020-09-19 22:11:40 +03:00
parent ed4e9f46d9
commit b3d51a954a
1 changed files with 0 additions and 65 deletions

View File

@ -317,11 +317,6 @@ public class SarcStats {
dfs.mkdirs(new Path(sarcsReportPathArray + "/" + issn));
dfs.mkdirs(new Path(sarcsReportPathNonArray + "/" + issn));
// System.out.println("====> END ===== ");
//
// if (true)
// System.exit(0);
while (start.before(end)) {
// String reportUrl =
// "http://irus.mimas.ac.uk/api/sushilite/v1_7/GetReport/?Report=IR1&Release=4&RequestorID=OpenAIRE&BeginDate="
@ -375,14 +370,12 @@ public class SarcStats {
}
// Creating the file in the filesystem for the ItemIdentifier as array object
// FileSystem fsArray = FileSystem.get(new Configuration());
String filePathArray = sarcsReportPathArray + "/" + issn + "/" + "SarcsARReport" +
simpleDateFormat.format(start.getTime()) + ".json";
System.out.println("Storing to file: " + filePathArray);
FSDataOutputStream finArray = dfs.create(new Path(filePathArray), true);
// Creating the file in the filesystem for the ItemIdentifier as array object
// FileSystem fsNonArray = FileSystem.get(new Configuration());
String filePathNonArray = sarcsReportPathNonArray + "/" + issn + "/" + "SarcsARReport" +
simpleDateFormat.format(start.getTime()) + ".json";
System.out.println("Storing to file: " + filePathNonArray);
@ -414,69 +407,11 @@ public class SarcStats {
if (fileNonArray.length() == 0)
fileNonArray.delete();
// fsArray.close();
// fsNonArray.close();
//////////////////
// JSONObject jsonObjectRow = (JSONObject) aJsonArray;
// JSONArray itemIdentifier = new JSONArray();
// obj = jsonObjectRow.get("c:ItemIdentifier");
// if (obj instanceof JSONObject) {
// itemIdentifier.add(obj);
// } else {
// // JSONArray itemIdentifier = (JSONArray) jsonObjectRow.get("c:ItemIdentifier");
// itemIdentifier = (JSONArray) obj;
// }
// for (Object identifier : itemIdentifier) {
// JSONObject doi = (JSONObject) identifier;
// if (doi.get("c:Type").toString().equals("DOI")) {
// rid = doi.get("c:Value").toString();
// // System.out.println("DOI: " + rid);
// break;
// }
// }
// if (rid.isEmpty()) {
// continue;
// }
//
// JSONObject itemPerformance = (JSONObject) jsonObjectRow.get("c:ItemPerformance");
// // for (Object perf : itemPerformance) {
// JSONObject performance = (JSONObject) itemPerformance;
// JSONObject periodObj = (JSONObject) performance.get("c:Period");
// String period = periodObj.get("c:Begin").toString();
// JSONObject instanceObj = (JSONObject) performance.get("c:Instance");
// String type = instanceObj.get("c:MetricType").toString();
// String count = instanceObj.get("c:Count").toString();
// // System.out.println(rid + " : " + period + " : " + count);
//
// preparedStatement.setString(1, "SARC-OJS");
// preparedStatement.setString(2, issn);
// // preparedStatement.setString(2, url);
// preparedStatement.setString(3, rid);
// preparedStatement.setString(4, period);
// preparedStatement.setString(5, type);
// preparedStatement.setInt(6, Integer.parseInt(count));
// preparedStatement.addBatch();
// batch_size++;
// if (batch_size == 10000) {
// preparedStatement.executeBatch();
// ConnectDB.getConnection().commit();
// batch_size = 0;
// }
// // }
//
// // break;
// }
//////////////////
// break;
}
dfs.close();
// preparedStatement.executeBatch();
// ConnectDB.getConnection().commit();
ConnectDB.getConnection().close();
}
private void renameKeysRecursively(String delimiter, JSONArray givenJsonObj) throws Exception {