Exemplo n.º 1
0
 private int getNumSecrets(Path secretsPath) throws Exception {
   FileSystem fileSystem = FileSystem.get(secretsPath.toUri(), getConf());
   FSDataInputStream inputStream = fileSystem.open(secretsPath);
   BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream));
   String currentLine;
   int numLines = 0;
   while ((currentLine = reader.readLine()) != null) {
     if (!currentLine.isEmpty()) {
       numLines++;
     }
   }
   reader.close();
   return numLines;
 }