forked from D-Net/dnet-hadoop
Minor changes to print the Sarc keys
This commit is contained in:
parent
ba33df29b4
commit
8bb00add0d
|
@ -11,6 +11,7 @@ import java.sql.ResultSet;
|
||||||
import java.sql.Statement;
|
import java.sql.Statement;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.Calendar;
|
import java.util.Calendar;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
import org.apache.hadoop.conf.Configuration;
|
import org.apache.hadoop.conf.Configuration;
|
||||||
import org.apache.hadoop.fs.FSDataOutputStream;
|
import org.apache.hadoop.fs.FSDataOutputStream;
|
||||||
|
@ -63,7 +64,8 @@ public class SarcStats {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void processSarc(String sarcsReportPath) throws Exception {
|
public void processSarc(String sarcsReportPath) throws Exception {
|
||||||
processARReport(sarcsReportPath, "https://revistas.rcaap.pt/motricidade/sushiLite/v1_7/", "1646-107X");
|
// There was a problem to download the following file
|
||||||
|
// processARReport(sarcsReportPath, "https://revistas.rcaap.pt/motricidade/sushiLite/v1_7/", "1646-107X");
|
||||||
processARReport(sarcsReportPath, "https://revistas.rcaap.pt/antropologicas/sushiLite/v1_7/", "0873-819X");
|
processARReport(sarcsReportPath, "https://revistas.rcaap.pt/antropologicas/sushiLite/v1_7/", "0873-819X");
|
||||||
processARReport(sarcsReportPath, "https://revistas.rcaap.pt/interaccoes/sushiLite/v1_7/", "1646-2335");
|
processARReport(sarcsReportPath, "https://revistas.rcaap.pt/interaccoes/sushiLite/v1_7/", "1646-2335");
|
||||||
processARReport(sarcsReportPath, "https://revistas.rcaap.pt/cct/sushiLite/v1_7/", "2182-3030");
|
processARReport(sarcsReportPath, "https://revistas.rcaap.pt/cct/sushiLite/v1_7/", "2182-3030");
|
||||||
|
@ -185,6 +187,15 @@ public class SarcStats {
|
||||||
for (Object aJsonArray : jsonArray) {
|
for (Object aJsonArray : jsonArray) {
|
||||||
|
|
||||||
JSONObject jsonObjectRow = (JSONObject) aJsonArray;
|
JSONObject jsonObjectRow = (JSONObject) aJsonArray;
|
||||||
|
|
||||||
|
Set<String> jkeys = jsonObjectRow.keySet();
|
||||||
|
for (String jkey : jkeys) {
|
||||||
|
System.out.println("++++> " + jkey);
|
||||||
|
String[] splitArray = jkey.split("c:");
|
||||||
|
jkey = splitArray[splitArray.length - 1];
|
||||||
|
System.out.println("New jkey: " + jkey);
|
||||||
|
}
|
||||||
|
|
||||||
fin.write(jsonObjectRow.toJSONString().getBytes());
|
fin.write(jsonObjectRow.toJSONString().getBytes());
|
||||||
fin.writeChar('\n');
|
fin.writeChar('\n');
|
||||||
}
|
}
|
||||||
|
@ -243,8 +254,8 @@ public class SarcStats {
|
||||||
// break;
|
// break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// preparedStatement.executeBatch();
|
preparedStatement.executeBatch();
|
||||||
// ConnectDB.getConnection().commit();
|
ConnectDB.getConnection().commit();
|
||||||
ConnectDB.getConnection().close();
|
ConnectDB.getConnection().close();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue