public static void renameCubeForDeletion(int partitionCount,String storePath,String schemaName,String cubeName){
  String cubeNameWithPartition="";
  String schemaNameWithPartition="";
  String fullPath="";
  String newFilePath="";
  String newFileName="";
  Callable<Void> c=null;
  long time=System.currentTimeMillis();
  FileFactory.FileType fileType=null;
  ExecutorService executorService=Executors.newFixedThreadPool(10);
  for (int i=0; i < partitionCount; i++) {
    schemaNameWithPartition=schemaName + '_' + i;
    cubeNameWithPartition=cubeName + '_' + i;
    newFileName=cubeNameWithPartition + '_' + time;
    fullPath=storePath + File.separator + schemaNameWithPartition+ File.separator+ cubeNameWithPartition;
    newFilePath=storePath + File.separator + schemaNameWithPartition+ File.separator+ newFileName;
    fileType=FileFactory.getFileType(fullPath);
    try {
      if (FileFactory.isFileExist(fullPath,fileType)) {
        CarbonFile file=FileFactory.getCarbonFile(fullPath,fileType);
        boolean isRenameSuccessfull=file.renameTo(newFilePath);
        if (!isRenameSuccessfull) {
          LOGGER.error("Problem renaming the cube :: " + fullPath);
          c=new DeleteCube(file);
          executorService.submit(c);
        }
 else {
          c=new DeleteCube(FileFactory.getCarbonFile(newFilePath,fileType));
          executorService.submit(c);
        }
      }
    }
 catch (    IOException e) {
      LOGGER.error("Problem renaming the cube :: " + fullPath);
    }
  }
  executorService.shutdown();
}

public static void renameCubeForDeletion ( int partitionCount , String storePath , String schemaName , String cubeName ) { String cubeNameWithPartition = "" ; String schemaNameWithPartition = "" ; String fullPath = "" ; String newFilePath = "" ; String newFileName = "" ; Callable < Void > c = null ; long time = System . currentTimeMillis ( ) ; FileFactory . FileType fileType = null ; ExecutorService executorService = Executors . newFixedThreadPool ( 10 ) ; for ( int i = 0 ; i < partitionCount ; i ++ ) { schemaNameWithPartition = schemaName + '_' + i ; cubeNameWithPartition = cubeName + '_' + i ; newFileName = cubeNameWithPartition + '_' + time ; fullPath = storePath + File . separator + schemaNameWithPartition + File . separator + cubeNameWithPartition ; newFilePath = storePath + File . separator + schemaNameWithPartition + File . separator + newFileName ; fileType = FileFactory . getFileType ( fullPath ) ; try { if ( FileFactory . isFileExist ( fullPath , fileType ) ) { CarbonFile file = FileFactory . getCarbonFile ( fullPath , fileType ) ; boolean isRenameSuccessfull = file . renameTo ( newFilePath ) ; if ( ! isRenameSuccessfull ) { LOGGER . error ( "Problem renaming the cube :: " + fullPath ) ; c = new DeleteCube ( file ) ; executorService . submit ( c ) ; } else { c = new DeleteCube ( FileFactory . getCarbonFile ( newFilePath , fileType ) ) ; executorService . submit ( c ) ; } } } catch ( IOException e ) { LOGGER . error ( "Problem renaming the cube :: " + fullPath ) ; } } executorService . shutdown ( ) ; }
this function will rename the cube to be deleted
