Examples of FileManager


Examples of com.sleepycat.je.log.FileManager

             * memory available to this process.
             */
            memoryBudget =
                new MemoryBudget(this, sharedCacheEnv, configManager);

            fileManager = new FileManager(this, envHome, isReadOnly);
            if (!envConfig.getAllowCreate() && !fileManager.filesExist()) {
                throw new EnvironmentNotFoundException
                    (this, "Home directory: " + envHome);
            }

View Full Code Here

Examples of com.sleepycat.je.log.FileManager

                /*
                 * Calculate the full path for a specified log file name,
                 * especially when this Feeder is configured to run with sub
                 * directories.
                 */
                FileManager fMgr = feederManager.getEnvImpl().getFileManager();
                File file = new File(fMgr.getFullFileName(fileName));

                if (!file.exists()) {
                    throw EnvironmentFailureException.unexpectedState
                        ("Log file not found: " + fileName);
                }
View Full Code Here

Examples of com.sleepycat.je.log.FileManager

        /*
         * If we can't get an exclusive lock, then there are other processes
         * with the environment open read-only and we can't delete any files.
         */
        final FileManager fileManager = env.getFileManager();
        if (!fileManager.lockEnvironment(false, true)) {
            LoggerUtils.traceAndLog(logger, env, Level.WARNING,
                                    "Cleaner has " + safeToDeleteFiles.size() +
                                    " files not deleted because of read-only" +
                                    " processes.");
            return;
        }

        /* Be sure to release the environment lock in the finally block. */
        try {
            /* Synchronize while deleting files to block DbBackup.start. */
            synchronized (protectedFileRanges) {

                /* Intersect the protected ranges for active DbBackups. */
                if (!protectedFileRanges.isEmpty()) {
                    unprotectedFiles = unprotectedFiles.headSet
                        (Collections.min(protectedFileRanges));
                }

                /* Delete the unprotected files. */
                for (final Iterator<Long> iter = unprotectedFiles.iterator();
                     iter.hasNext();) {
                    final Long fileNum = iter.next();
                    final boolean deleted;
                    try {
                        if (expunge) {
                            deleted = fileManager.deleteFile(fileNum);
                        } else {
                            deleted = fileManager.renameFile
                                (fileNum, FileManager.DEL_SUFFIX);
                        }
                    } catch (IOException e) {
                        throw new EnvironmentFailureException
                            (env, EnvironmentFailureReason.LOG_WRITE,
                             "Unable to delete or rename " + fileNum, e);
                    }
                    if (deleted) {

                        /*
                         * Deletion was successful.  Log a trace message for
                         * debugging of log cleaning behavior.
                         */
                        LoggerUtils.traceAndLog(logger, env, Level.FINE,
                                                "Cleaner deleted file 0x" +
                                                Long.toHexString(fileNum));
                    } else if (!fileManager.isFileValid(fileNum)) {

                        /*
                         * Somehow the file was previously deleted.  This could
                         * indicate an internal state error, and therefore we
                         * output a trace message.  But we should not
                         * repeatedly attempt to delete it, so we do remove it
                         * from the profile below.
                         */
                        LoggerUtils.traceAndLog
                            (logger, env, Level.SEVERE,
                             "Cleaner deleteSafeToDeleteFiles Log file 0x" +
                             Long.toHexString(fileNum) + " was previously " +
                             (expunge ? "deleted" : "renamed") + ".  State: " +
                             fileSelector);
                    } else {

                        /*
                         * We will retry the deletion later if file still
                         * exists.  The deletion could have failed on Windows
                         * if the file was recently closed.  Remove the file
                         * from unprotectedFiles. That way, we won't remove it
                         * from the FileSelector's safe-to-delete set or the UP
                         * below, and we will retry the file deletion later.
                         */
                        iter.remove();

                        LoggerUtils.traceAndLog
                            (logger, env, Level.WARNING,
                             "Cleaner deleteSafeToDeleteFiles Log file 0x" +
                             Long.toHexString(fileNum) + " could not be " +
                             (expunge ? "deleted" : "renamed") + ". This " +
                             "operation will be retried at the next " +
                             "checkpoint. State: " + fileSelector);
                    }
                }
            }
        } finally {
            fileManager.releaseExclusiveLock();
        }

        /*
         * Now unprotectedFiles contains only the files we deleted above.  We
         * can update the UP (and FileSelector) here outside of the
View Full Code Here

Examples of com.sleepycat.je.log.FileManager

        /*
         * Sort so that the entries are made invisible in disk order for better
         * efficiency.
         */
        FileManager fileManager = envImpl.getFileManager();

        Collections.sort(rollbackLsns);
        List<Long> perFileLsns = new ArrayList<Long>();
        long currentFileNum = -1;

        for (Long lsn : rollbackLsns) {

            /* See if we have moved to a new file. */
            if (DbLsn.getFileNumber(lsn) != currentFileNum) {
          /*
           * We've moved on to a new file. Make the previous set of
           * lsns invisible.
           */
          fileManager.makeInvisible(currentFileNum, perFileLsns);

                currentFileNum = DbLsn.getFileNumber(lsn);
                filesToFsync.add(currentFileNum);

                /* make a new set to house the lsns for the next file. */
                perFileLsns = new ArrayList<Long>();
            }
            perFileLsns.add(lsn);
        }

        /* Take care of the last set. */
        fileManager.makeInvisible(currentFileNum, perFileLsns);
    }
View Full Code Here

Examples of com.taobao.zeus.store.FileManager

    List<Map<String, String>> resources = new ArrayList<Map<String,String>>();
    // 处理脚本中的 资源引用 语句
    script = resolvScriptResource(resources, script, applicationContext);
    jobContext.setResources(resources);
    hp.setProperty(PropertyKeys.JOB_SCRIPT, script);
    FileManager fileManager=(FileManager) applicationContext.getBean("fileManager");
    ProfileManager profileManager=(ProfileManager) applicationContext.getBean("profileManager");
    String owner=fileManager.getFile(history.getFileId()).getOwner();
    Profile profile=profileManager.findByUid(owner);
    if(profile!=null && profile.getHadoopConf()!=null){
      for(String key:profile.getHadoopConf().keySet()){
        hp.setProperty(key, profile.getHadoopConf().get(key));
      }
View Full Code Here

Examples of com.teamjmonkey.file.FileManager

        new DatabaseTest().start(Type.Headless);
    }

    @Override
    public void simpleInitApp() {
        FileManager fileManager = new FileManager(assetManager);
        fileManager.setHighScore(27, 1);
        System.out.println(fileManager.getHighScore(1));
        boolean completed = fileManager.getCompleted(2);
        fileManager.setPostProcessing(false);
        System.out.println(fileManager.getPostProcessing());
        fileManager.getFastestTime(2);

        System.out.println("gersdsds" + fileManager.getMuteMusic());
        System.out.println("gereesss" + fileManager.getMuteSoundFX());
        System.out.println("sfdsdfs" + completed);
    }
View Full Code Here

Examples of com.vmware.vim.binding.vim.FileManager

      final String srcDsPath = getDsPath(srcDs, srcPath);
      final String dstDsPath = getDsPath(dstDs, dstPath);
      VcTask task = VcContext.getTaskMgr().execute(new IVcTaskBody() {
         @Override
         public VcTask body() throws Exception {
            FileManager mgr = VcContext.getService().getFileManager();
            return new VcTask(TaskType.CopyFile,
               mgr.copyFile(srcDsPath, srcDs.getDatacenterMoRef(),
                            dstDsPath, dstDs.getDatacenterMoRef(), true),
               callback);
         }
      });
      return task;
View Full Code Here

Examples of com.vmware.vim25.mo.FileManager

      new URL(args[0]), args[1], args[2], true);

    Datacenter dc = (Datacenter)new InventoryNavigator(
        si.getRootFolder()).searchManagedEntity(
            "Datacenter", "ha-datacenter");
    FileManager fileMgr = si.getFileManager();
    if(fileMgr==null)
    {
      System.out.println("FileManager not available.");
      si.getServerConnection().logout();
      return;
    }
   
    String basePath = "[storage1 (2)] Nostalgia011";
    String dirPath = basePath + "/" + "testDir";
    // create parent directories if needed - true
    fileMgr.makeDirectory(dirPath, dc, true);
   
    String srcPath = basePath + "/Nostalgia011.vmdk";
    String dstPath = dirPath + "/copy of Nostalgia011.vmdk";
    Task cTask = fileMgr.copyDatastoreFile_Task(srcPath, dc,
        dstPath, dc, true);

    if(cTask.waitForMe()==Task.SUCCESS)
    {
      System.out.println("File copied successfully!");
    }
    else
    {
      System.out.println("File copy failed!");
      return;
    }
    Thread.sleep(30*1000);
   
    fileMgr.deleteDatastoreFile_Task(dstPath, dc);
    fileMgr.deleteDatastoreFile_Task(dirPath, dc);
    si.getServerConnection().logout();
  }
View Full Code Here

Examples of com.volantis.osgi.cm.store.FileManager

            throw new IOException(
                    "Cannot persist configuration as cannot access file" +
                            " system");
        }

        FileManager fileManager = new FileManagerImpl(
                rootDir, MAX_FILES_PER_DIR, MAX_DIRS_PER_DIR);

        ConfigurationStore store = new ConfigurationStoreImpl(fileManager);

        ConfigurationManager manager =
View Full Code Here

Examples of cx.fbn.nevernote.config.FileManager

    public static void setup(StartupConfig startupConfig) throws InitializationException  {
        settings = new QSettings("fbn.cx", startupConfig.getName());
        disableViewing = startupConfig.getDisableViewing();
        syncOnly = startupConfig.isSyncOnly();

        fileManager = new FileManager(startupConfig.getHomeDirPath(), startupConfig.getProgramDirPath());


    getServer()// Setup URL to connect to
   
    // Get regular expressions used to parse out words
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.