test_class.declarator: fileStateDao
test_class.modifier: private
test_class.original_string: private FileStateDao fileStateDao;
test_class.type: FileStateDao
test_class.var_name: fileStateDao
test_class.file: smart-metastore/src/test/java/org/smartdata/metastore/dao/TestFileStateDao.java
test_class.identifier: TestFileStateDao
test_class.superclass: extends TestDaoUtil
test_case.body: @Test
    public void testInsertUpdate() throws Exception {
      FileState fileState1 = new FileState("/file1", FileState.FileType.COMPACT,
          FileState.FileStage.PROCESSING);
      FileState fileState2 = new FileState("/file2", FileState.FileType.COMPRESSION,
          FileState.FileStage.DONE);
      fileStateDao.insertUpdate(fileState1);
      fileStateDao.insertUpdate(fileState2);
      List<FileState> fileStates = fileStateDao.getAll();
      Assert.assertEquals(2, fileStates.size());
      Assert.assertEquals(fileState1, fileStateDao.getByPath("/file1"));
      Assert.assertEquals(fileState2, fileStateDao.getByPath("/file2"));
  
      fileState1 = new FileState("/file1", FileState.FileType.COMPACT,
          FileState.FileStage.DONE);
      fileStateDao.insertUpdate(fileState1);
      fileStates = fileStateDao.getAll();
      Assert.assertEquals(2, fileStates.size());
      Assert.assertEquals(fileState1, fileStateDao.getByPath("/file1"));
      Assert.assertEquals(fileState2, fileStateDao.getByPath("/file2"));
    }
test_case.class_method_signature: TestFileStateDao.testInsertUpdate()
test_case.full_signature: @Test public void testInsertUpdate()
test_case.identifier: testInsertUpdate
test_case.invocations: insertUpdate insertUpdate getAll assertEquals size assertEquals getByPath assertEquals getByPath insertUpdate getAll assertEquals size assertEquals getByPath assertEquals getByPath
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testInsertUpdate()
focal_class.declarator: TABLE_NAME = "file_state"
focal_class.modifier: private static final
focal_class.original_string: private static final String TABLE_NAME = "file_state";
focal_class.type: String
focal_class.var_name: TABLE_NAME
focal_class.declarator: dataSource
focal_class.modifier: private
focal_class.original_string: private DataSource dataSource;
focal_class.type: DataSource
focal_class.var_name: dataSource
focal_class.file: smart-metastore/src/main/java/org/smartdata/metastore/dao/FileStateDao.java
focal_class.identifier: FileStateDao
focal_class.class_method_signature: FileStateDao.setDataSource(DataSource dataSource)
focal_class.full_signature: public void setDataSource(DataSource dataSource)
focal_class.identifier: setDataSource
focal_class.modifiers: public
focal_class.parameters: (DataSource dataSource)
focal_class.return: void
focal_class.signature: void setDataSource(DataSource dataSource)
focal_class.class_method_signature: FileStateDao.FileStateDao(DataSource dataSource)
focal_class.full_signature: public  FileStateDao(DataSource dataSource)
focal_class.identifier: FileStateDao
focal_class.modifiers: public
focal_class.parameters: (DataSource dataSource)
focal_class.signature:  FileStateDao(DataSource dataSource)
focal_class.class_method_signature: FileStateDao.insertUpdate(FileState fileState)
focal_class.full_signature: public void insertUpdate(FileState fileState)
focal_class.identifier: insertUpdate
focal_class.modifiers: public
focal_class.parameters: (FileState fileState)
focal_class.return: void
focal_class.signature: void insertUpdate(FileState fileState)
focal_class.class_method_signature: FileStateDao.batchInsertUpdate(final FileState[] fileStates)
focal_class.full_signature: public int[] batchInsertUpdate(final FileState[] fileStates)
focal_class.identifier: batchInsertUpdate
focal_class.modifiers: public
focal_class.parameters: (final FileState[] fileStates)
focal_class.return: int[]
focal_class.signature: int[] batchInsertUpdate(final FileState[] fileStates)
focal_class.class_method_signature: FileStateDao.getByPath(String path)
focal_class.full_signature: public FileState getByPath(String path)
focal_class.identifier: getByPath
focal_class.modifiers: public
focal_class.parameters: (String path)
focal_class.return: FileState
focal_class.signature: FileState getByPath(String path)
focal_class.class_method_signature: FileStateDao.getByPaths(List<String> paths)
focal_class.full_signature: public Map<String, FileState> getByPaths(List<String> paths)
focal_class.identifier: getByPaths
focal_class.modifiers: public
focal_class.parameters: (List<String> paths)
focal_class.return: Map<String, FileState>
focal_class.signature: Map<String, FileState> getByPaths(List<String> paths)
focal_class.class_method_signature: FileStateDao.getAll()
focal_class.full_signature: public List<FileState> getAll()
focal_class.identifier: getAll
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: List<FileState>
focal_class.signature: List<FileState> getAll()
focal_class.class_method_signature: FileStateDao.deleteByPath(String path, boolean recursive)
focal_class.full_signature: public void deleteByPath(String path, boolean recursive)
focal_class.identifier: deleteByPath
focal_class.modifiers: public
focal_class.parameters: (String path, boolean recursive)
focal_class.return: void
focal_class.signature: void deleteByPath(String path, boolean recursive)
focal_class.class_method_signature: FileStateDao.batchDelete(final List<String> paths)
focal_class.full_signature: public int[] batchDelete(final List<String> paths)
focal_class.identifier: batchDelete
focal_class.modifiers: public
focal_class.parameters: (final List<String> paths)
focal_class.return: int[]
focal_class.signature: int[] batchDelete(final List<String> paths)
focal_class.class_method_signature: FileStateDao.deleteAll()
focal_class.full_signature: public void deleteAll()
focal_class.identifier: deleteAll
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void deleteAll()
focal_method.body: public void insertUpdate(FileState fileState) {
      JdbcTemplate jdbcTemplate = new JdbcTemplate(dataSource);
      String sql = "REPLACE INTO " + TABLE_NAME + " (path, type, stage) VALUES (?,?,?)";
      jdbcTemplate.update(sql, fileState.getPath(), fileState.getFileType().getValue(),
          fileState.getFileStage().getValue());
    }
focal_method.class_method_signature: FileStateDao.insertUpdate(FileState fileState)
focal_method.full_signature: public void insertUpdate(FileState fileState)
focal_method.identifier: insertUpdate
focal_method.invocations: update getPath getValue getFileType getValue getFileStage
focal_method.modifiers: public
focal_method.parameters: (FileState fileState)
focal_method.return: void
focal_method.signature: void insertUpdate(FileState fileState)