Examples of FileReference


Examples of com.fasterxml.storemate.store.file.FileReference

            storable = _storableConverter.encodeInlined(key0, creationTime,
                    stdMetadata, customMetadata, data);
        } else {
            // otherwise, need to create file and all that fun...
            final long fileCreationTime = _timeMaster.currentTimeMillis();
            FileReference fileRef = _fileManager.createStorageFile(key0,
                    stdMetadata.compression, fileCreationTime);
            try {
                final long nanoStart = (diag == null) ? 0L : _timeMaster.nanosForDiagnostics();
                _throttler.performFileWrite(source, fileCreationTime, key0, fileRef.getFile(),
                        new FileOperationCallback<Void>() {
                    @Override
                    public Void perform(long operationTime, StorableKey key, Storable value, File externalFile)
                            throws IOException, StoreException {
                        final long fsStart = (diag == null) ? 0L : _timeMaster.nanosForDiagnostics();
                        IOUtil.writeFile(externalFile, data);
                        if (diag != null) {
                            diag.addFileWriteAccess(nanoStart,  fsStart,  _timeMaster, data.byteLength());
                        }
                        return null;
                    }
                });
            } catch (IOException e) {
                // better remove the file, if one exists...
                fileRef.getFile().delete();
                throw new StoreException.IO(key0,
                        "Failed to write storage file of "+data.byteLength()+" bytes: "+e.getMessage(), e);
            }
            // but modtime better be taken only now, as above may have taken some time (I/O bound)
            creationTime = _timeMaster.currentTimeMillis();
View Full Code Here

Examples of com.fasterxml.storemate.store.file.FileReference

         * bucket, start cranking...
         */
       
        // So: start by creating the result file
        long fileCreationTime = _timeMaster.currentTimeMillis();
        final FileReference fileRef = _fileManager.createStorageFile(key0, stdMetadata.compression, fileCreationTime);
        File storedFile = fileRef.getFile();

        final OutputStream out;
        final CountingOutputStream compressedOut;

        if (skipCompression) {
            compressedOut = null;
            out = new FileOutputStream(storedFile);
        } else {
            compressedOut = new CountingOutputStream(new FileOutputStream(storedFile),
                    new IncrementalMurmur3Hasher());
            out = Compressors.compressingStream(compressedOut, stdMetadata.compression);
        }
        final IncrementalMurmur3Hasher hasher = new IncrementalMurmur3Hasher(HASH_SEED);       

        // Need to mix-n-match read, write; trickier to account for each part.
        final long nanoStart = (diag == null) ? 0L : _timeMaster.nanosForDiagnostics();
        long copiedBytes = _throttler.performFileWrite(source,
                fileCreationTime, key0, fileRef.getFile(),
                new FileOperationCallback<Long>() {
            @Override
            public Long perform(long operationTime, StorableKey key, Storable value, File externalFile)
                    throws IOException, StoreException {
                final long fsStart = (diag == null) ? 0L : _timeMaster.nanosForDiagnostics();
View Full Code Here

Examples of com.fasterxml.storemate.store.file.FileReference

            OverwriteChecker allowOverwrites,
            final byte[] readBuffer, final boolean skipCompression, final StreamyBytesMemBuffer offHeap)
        throws IOException, StoreException
    {
        long fileCreationTime = _timeMaster.currentTimeMillis();
        final FileReference fileRef = _fileManager.createStorageFile(key0, stdMetadata.compression, fileCreationTime);
        File storedFile = fileRef.getFile();

        final OutputStream out;
        final CountingOutputStream compressedOut;
       
        if (skipCompression) {
            compressedOut = null;
            out = new FileOutputStream(storedFile);
        } else {
            compressedOut = new CountingOutputStream(new FileOutputStream(storedFile),
                    new IncrementalMurmur3Hasher());
            out = Compressors.compressingStream(compressedOut, stdMetadata.compression);
        }
        final IncrementalMurmur3Hasher hasher = new IncrementalMurmur3Hasher(HASH_SEED);       

        final long nanoStart = (diag == null) ? 0L : _timeMaster.nanosForDiagnostics();
        long copiedBytes = _throttler.performFileWrite(source,
                fileCreationTime, key0, fileRef.getFile(),
                new FileOperationCallback<Long>() {
            @Override
            public Long perform(long operationTime, StorableKey key, Storable value, File externalFile)
                    throws IOException, StoreException {
                final long fsStart = (diag == null) ? 0L : _timeMaster.nanosForDiagnostics();
View Full Code Here

Examples of com.fasterxml.storemate.store.file.FileReference

        if (!result.succeeded()) {
            // One piece of clean up: for failed insert, delete backing file, if any
//            if (!allowOverwrite) {
            // otherwise, may need to delete file that was created
            FileReference ref = stdMetadata.dataFile;
            if (ref != null) {
                _deleteBackingFile(key0, ref.getFile());
            }
        }
        return result;
    }
View Full Code Here

Examples of com.infoclinika.mssharing.model.internal.entity.FileReference

        return searchResults;
    }

    private SearchRunResult createSearchRunResult(SequestSearchPerFileResultResponse sResult, SearchRun searchRun) {
        return (sResult.errorMessage != null) ? new SearchRunResult(sResult.errorMessage)
                        : new SearchRunResult(searchRun, new FileReference(sResult.sqtFileRef), new FileReference(sResult.sqtDecoyFileRef),
                        new FileReference(sResult.resultsFileRef), new FileReference(sResult.isotopeGroupListFileRef),
                new FileReference(sResult.ms2FileRef), new FileReference(sResult.mzmlFileRef));
    }
View Full Code Here

Examples of com.infoclinika.mssharing.model.internal.entity.FileReference

    public MsDaplChartItem readChartInfoBySearchResult(long searchResultId) {
        final SearchResult searchResult = searchResultRepository.findOne(searchResultId);
        final MS2Scan scan = searchResult.getScan();
        final SearchRun searchRun = searchResult.getSearchRun();
        final String fileName = searchRun.getFile().getFileMetaData().getName();
        final FileReference chartDataRef = scan.getChartDataRef();
        final String key = chartDataRef.getKey();
        File file = new File(key);
        if (!(file.exists() && file.isFile())) {
            file = downloadMsDaplChartRef(chartDataRef, file);
        }
        final Gson gson = new GsonBuilder().serializeSpecialFloatingPointValues().create();
View Full Code Here

Examples of com.infoclinika.mssharing.model.internal.entity.FileReference

        final MS2Scan scan = scanRepository.findOne(scanId);

        final IsotopeGroupPerFile isotopeGroupPerFile = scan.getIsotopeGroupPerFile();
        final SearchRun searchRun = isotopeGroupPerFile.getSearchRun();
        final String fileName = searchRun.getFile().getFileMetaData().getName();
        final FileReference chartDataRef = scan.getChartDataRef();
        final String key = chartDataRef.getKey();
        File file = new File(key);
        if (!(file.exists() && file.isFile())) {
            file = downloadMsDaplChartRef(chartDataRef, file);
        }
        final Gson gson = new GsonBuilder().serializeSpecialFloatingPointValues().create();
View Full Code Here

Examples of com.infoclinika.mssharing.model.internal.entity.FileReference

        FileOperations.cleanupFile(file);
        for (IsotopeGroupPerFileDTO ig : isotopeGroups) {
            final IsotopeGroupPerFile isotopeGroupPerFile = isotopeGroupPerFileRepository.save(
                    new IsotopeGroupPerFile(searchRun, ig.getMonoMz(), ig.getRt(), ig.getCharge(), ig.getIntensity()));//todo performance!
            for (MS2ScanDTO scan : ig.getScans()) {
                final MS2Scan ms2Scan = new MS2Scan(scan.getScanNumber(), scan.getPrecursorIntensity(), isotopeGroupPerFile, new FileReference(scan.getChartInfoRef()));
                ms2ScanRepository.save(ms2Scan);       //todo performance!
            }
        }
    }
View Full Code Here

Examples of com.intellij.psi.impl.source.resolve.reference.impl.providers.FileReference

  private static FileReference[] shiftReferences(FileReference[] references, final int shift) {
    return ContainerUtil.map(references, new Function<FileReference, FileReference>() {
      @Override
      public FileReference fun(FileReference reference) {
        return new FileReference(
          reference.getFileReferenceSet(),
          reference.getRangeInElement().shiftRight(shift),
          reference.getIndex(),
          reference.getText()
        );
View Full Code Here

Examples of com.yiistorm.references.FileReference

                            filepath = viewAbsolutePath + "/" + uri.replace("//", "");
                        }
                        VirtualFile viewfile = baseDir.findFileByRelativePath(filepath);

                        if (viewfile != null && appDir != null) {
                            PsiReference ref = new FileReference(
                                    viewfile,
                                    uri,
                                    element,
                                    new TextRange(start, start + len),
                                    project,
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.