test_class.declarator: repository
test_class.modifier: private
test_class.original_string: private CassandraArchiveRepository repository;
test_class.type: CassandraArchiveRepository
test_class.var_name: repository
test_class.declarator: testArchiveJarFile
test_class.modifier: private
test_class.original_string: private Path testArchiveJarFile;
test_class.type: Path
test_class.var_name: testArchiveJarFile
test_class.declarator: gateway
test_class.modifier: private
test_class.original_string: private CassandraGateway gateway;
test_class.type: CassandraGateway
test_class.var_name: gateway
test_class.declarator: config
test_class.modifier: private
test_class.original_string: private CassandraArchiveRepositoryConfig config;
test_class.type: CassandraArchiveRepositoryConfig
test_class.var_name: config
test_class.file: nicobar-cassandra/src/test/java/com/netflix/nicobar/cassandra/CassandraArchiveRepositoryTest.java
test_class.identifier: CassandraArchiveRepositoryTest
test_case.body: @Test
      @SuppressWarnings("unchecked")
      public void testGetRows() throws Exception {
          EnumSet<Columns> columns = EnumSet.of(Columns.module_id, Columns.module_name);
          Rows<String, String> mockRows = mock(Rows.class);
          Row<String, String> row1 = mock(Row.class);
          Row<String, String> row2 = mock(Row.class);
          List<Row<String, String>> rowList = Arrays.asList(row1, row2);
  
          when(mockRows.iterator()).thenReturn(rowList.iterator());
  
          FutureTask<Rows<String, String>> future = new FutureTask<Rows<String, String>>(new Runnable() {
              @Override
              public void run() {
              }
          }, mockRows);
          ExecutorService executor = Executors.newFixedThreadPool(1);
          executor.execute(future);
          when(gateway.selectAsync(anyString())).thenReturn(future);
  
          repository.getRows(columns);
          List<String> selectList = new ArrayList<String>();
          for (int shardNum = 0; shardNum < config.getShardCount(); shardNum++) {
              selectList.add(repository.generateSelectByShardCql(columns, shardNum));
          }
  
          InOrder inOrder = inOrder(gateway);
          for (int shardNum = 0; shardNum < config.getShardCount(); shardNum++) {
              inOrder.verify(gateway).selectAsync(selectList.get(shardNum));
          }
      }
test_case.class_method_signature: CassandraArchiveRepositoryTest.testGetRows()
test_case.full_signature: @Test @SuppressWarnings("unchecked") public void testGetRows()
test_case.identifier: testGetRows
test_case.invocations: of mock mock mock asList thenReturn when iterator iterator newFixedThreadPool execute thenReturn when selectAsync anyString getRows getShardCount add generateSelectByShardCql inOrder getShardCount selectAsync verify get
test_case.modifiers: @Test @SuppressWarnings("unchecked") public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testGetRows()
focal_class.declarator: logger = LoggerFactory.getLogger(CassandraArchiveRepository.class)
focal_class.modifier: private final static
focal_class.original_string: private final static Logger logger = LoggerFactory.getLogger(CassandraArchiveRepository.class);
focal_class.type: Logger
focal_class.var_name: logger
focal_class.declarator: defaultView
focal_class.modifier: protected final
focal_class.original_string: protected final RepositoryView defaultView;
focal_class.type: RepositoryView
focal_class.var_name: defaultView
focal_class.declarator: config
focal_class.modifier: private final
focal_class.original_string: private final CassandraArchiveRepositoryConfig config;
focal_class.type: CassandraArchiveRepositoryConfig
focal_class.var_name: config
focal_class.declarator: cassandra
focal_class.modifier: private final
focal_class.original_string: private final CassandraGateway cassandra;
focal_class.type: CassandraGateway
focal_class.var_name: cassandra
focal_class.file: nicobar-cassandra/src/main/java/com/netflix/nicobar/cassandra/CassandraArchiveRepository.java
focal_class.identifier: CassandraArchiveRepository
focal_class.interfaces: implements ArchiveRepository
focal_class.class_method_signature: CassandraArchiveRepository.CassandraArchiveRepository(CassandraArchiveRepositoryConfig config)
focal_class.full_signature: public  CassandraArchiveRepository(CassandraArchiveRepositoryConfig config)
focal_class.identifier: CassandraArchiveRepository
focal_class.modifiers: public
focal_class.parameters: (CassandraArchiveRepositoryConfig config)
focal_class.signature:  CassandraArchiveRepository(CassandraArchiveRepositoryConfig config)
focal_class.class_method_signature: CassandraArchiveRepository.CassandraArchiveRepository(CassandraArchiveRepositoryConfig config, RepositoryView defaultView)
focal_class.full_signature: public  CassandraArchiveRepository(CassandraArchiveRepositoryConfig config, RepositoryView defaultView)
focal_class.identifier: CassandraArchiveRepository
focal_class.modifiers: public
focal_class.parameters: (CassandraArchiveRepositoryConfig config, RepositoryView defaultView)
focal_class.signature:  CassandraArchiveRepository(CassandraArchiveRepositoryConfig config, RepositoryView defaultView)
focal_class.class_method_signature: CassandraArchiveRepository.getRepositoryId()
focal_class.full_signature: @Override public String getRepositoryId()
focal_class.identifier: getRepositoryId
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getRepositoryId()
focal_class.class_method_signature: CassandraArchiveRepository.getDefaultView()
focal_class.full_signature: @Override public RepositoryView getDefaultView()
focal_class.identifier: getDefaultView
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: RepositoryView
focal_class.signature: RepositoryView getDefaultView()
focal_class.class_method_signature: CassandraArchiveRepository.getView(String view)
focal_class.full_signature: @Override public RepositoryView getView(String view)
focal_class.identifier: getView
focal_class.modifiers: @Override public
focal_class.parameters: (String view)
focal_class.return: RepositoryView
focal_class.signature: RepositoryView getView(String view)
focal_class.class_method_signature: CassandraArchiveRepository.insertArchive(JarScriptArchive jarScriptArchive)
focal_class.full_signature: @Override public void insertArchive(JarScriptArchive jarScriptArchive)
focal_class.identifier: insertArchive
focal_class.modifiers: @Override public
focal_class.parameters: (JarScriptArchive jarScriptArchive)
focal_class.return: void
focal_class.signature: void insertArchive(JarScriptArchive jarScriptArchive)
focal_class.class_method_signature: CassandraArchiveRepository.insertArchive(JarScriptArchive jarScriptArchive, Map<String, Object> initialDeploySpecs)
focal_class.full_signature: @Override public void insertArchive(JarScriptArchive jarScriptArchive, Map<String, Object> initialDeploySpecs)
focal_class.identifier: insertArchive
focal_class.modifiers: @Override public
focal_class.parameters: (JarScriptArchive jarScriptArchive, Map<String, Object> initialDeploySpecs)
focal_class.return: void
focal_class.signature: void insertArchive(JarScriptArchive jarScriptArchive, Map<String, Object> initialDeploySpecs)
focal_class.class_method_signature: CassandraArchiveRepository.getScriptArchives(Set<ModuleId> moduleIds)
focal_class.full_signature: @Override public Set<ScriptArchive> getScriptArchives(Set<ModuleId> moduleIds)
focal_class.identifier: getScriptArchives
focal_class.modifiers: @Override public
focal_class.parameters: (Set<ModuleId> moduleIds)
focal_class.return: Set<ScriptArchive>
focal_class.signature: Set<ScriptArchive> getScriptArchives(Set<ModuleId> moduleIds)
focal_class.class_method_signature: CassandraArchiveRepository.deleteArchive(ModuleId moduleId)
focal_class.full_signature: @Override public void deleteArchive(ModuleId moduleId)
focal_class.identifier: deleteArchive
focal_class.modifiers: @Override public
focal_class.parameters: (ModuleId moduleId)
focal_class.return: void
focal_class.signature: void deleteArchive(ModuleId moduleId)
focal_class.class_method_signature: CassandraArchiveRepository.getRows(EnumSet<?> columns)
focal_class.full_signature: protected Iterable<Row<String, String>> getRows(EnumSet<?> columns)
focal_class.identifier: getRows
focal_class.modifiers: protected
focal_class.parameters: (EnumSet<?> columns)
focal_class.return: Iterable<Row<String, String>>
focal_class.signature: Iterable<Row<String, String>> getRows(EnumSet<?> columns)
focal_class.class_method_signature: CassandraArchiveRepository.generateSelectByShardCql(EnumSet<?> columns, Integer shardNum)
focal_class.full_signature: protected String generateSelectByShardCql(EnumSet<?> columns, Integer shardNum)
focal_class.identifier: generateSelectByShardCql
focal_class.modifiers: protected
focal_class.parameters: (EnumSet<?> columns, Integer shardNum)
focal_class.return: String
focal_class.signature: String generateSelectByShardCql(EnumSet<?> columns, Integer shardNum)
focal_class.class_method_signature: CassandraArchiveRepository.verifyHash(byte[] expectedHashCode, byte[] content)
focal_class.full_signature: protected boolean verifyHash(byte[] expectedHashCode, byte[] content)
focal_class.identifier: verifyHash
focal_class.modifiers: protected
focal_class.parameters: (byte[] expectedHashCode, byte[] content)
focal_class.return: boolean
focal_class.signature: boolean verifyHash(byte[] expectedHashCode, byte[] content)
focal_class.class_method_signature: CassandraArchiveRepository.calculateHash(byte[] content)
focal_class.full_signature: protected byte[] calculateHash(byte[] content)
focal_class.identifier: calculateHash
focal_class.modifiers: protected
focal_class.parameters: (byte[] content)
focal_class.return: byte[]
focal_class.signature: byte[] calculateHash(byte[] content)
focal_class.class_method_signature: CassandraArchiveRepository.calculateShardNum(ModuleId moduleId)
focal_class.full_signature: protected int calculateShardNum(ModuleId moduleId)
focal_class.identifier: calculateShardNum
focal_class.modifiers: protected
focal_class.parameters: (ModuleId moduleId)
focal_class.return: int
focal_class.signature: int calculateShardNum(ModuleId moduleId)
focal_class.class_method_signature: CassandraArchiveRepository.getModuleSpec(ColumnList<String> columns)
focal_class.full_signature: private ScriptModuleSpec getModuleSpec(ColumnList<String> columns)
focal_class.identifier: getModuleSpec
focal_class.modifiers: private
focal_class.parameters: (ColumnList<String> columns)
focal_class.return: ScriptModuleSpec
focal_class.signature: ScriptModuleSpec getModuleSpec(ColumnList<String> columns)
focal_class.class_method_signature: CassandraArchiveRepository.getConfig()
focal_class.full_signature: public CassandraArchiveRepositoryConfig getConfig()
focal_class.identifier: getConfig
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: CassandraArchiveRepositoryConfig
focal_class.signature: CassandraArchiveRepositoryConfig getConfig()
focal_method.body: protected Iterable<Row<String, String>> getRows(EnumSet<?> columns) throws Exception {
          int shardCount = config.getShardCount();
  
          List<Future<Rows<String, String>>> futures = new ArrayList<Future<Rows<String, String>>>();
          for (int i = 0; i < shardCount; i++) {
              futures.add(cassandra.selectAsync(generateSelectByShardCql(columns, i)));
          }
  
          List<Row<String, String>> rows = new LinkedList<Row<String, String>>();
          for (Future<Rows<String, String>> f: futures) {
              Rows<String, String> shardRows = f.get();
              Iterables.addAll(rows, shardRows);
          }
  
          return rows;
      }
focal_method.class_method_signature: CassandraArchiveRepository.getRows(EnumSet<?> columns)
focal_method.full_signature: protected Iterable<Row<String, String>> getRows(EnumSet<?> columns)
focal_method.identifier: getRows
focal_method.invocations: getShardCount add selectAsync generateSelectByShardCql get addAll
focal_method.modifiers: protected
focal_method.parameters: (EnumSet<?> columns)
focal_method.return: Iterable<Row<String, String>>
focal_method.signature: Iterable<Row<String, String>> getRows(EnumSet<?> columns)