Examples of blobContainer()


Examples of io.crate.blob.v2.BlobShard.blobContainer()

                                             List<Input<?>> inputs,
                                             List<BlobCollectorExpression<?>> expressions,
                                             Input<Boolean> condition) throws Exception {
        CollectingProjector projector = new CollectingProjector();
        BlobShard blobShard = mock(BlobShard.class);
        when(blobShard.blobContainer()).thenReturn(container);

        BlobDocCollector collector = new BlobDocCollector(
                blobShard,
                inputs,
                expressions,
View Full Code Here

Examples of io.crate.blob.v2.BlobShard.blobContainer()

        assertEquals(indexCounter.get(), uploadedDigests.size());

        blobIndices = cluster().getInstance(BlobIndices.class, node2);
        for (String digest : uploadedDigests) {
            BlobShard blobShard = blobIndices.localBlobShard(BlobIndices.fullIndexName("test"), digest);
            long length = blobShard.blobContainer().getFile(digest).length();
            assertThat(length, greaterThanOrEqualTo(1L));
        }

    }
}
View Full Code Here

Examples of io.crate.blob.v2.BlobShard.blobContainer()

    public void startTransfer(int shardId, StartBlobRequest request, StartBlobResponse response) {
        logger.debug("startTransfer {} {}", request.transferId(), request.isLast());

        BlobShard blobShard = blobIndices.blobShardSafe(request.index(), shardId);
        File existing = blobShard.blobContainer().getFile(request.id());
        long size = existing.length();
        if (existing.exists()) {
            // the file exists
            response.status(RemoteDigestBlob.Status.EXISTS);
            response.size(size);
View Full Code Here

Examples of io.crate.blob.v2.BlobShard.blobContainer()

            response.status(RemoteDigestBlob.Status.EXISTS);
            response.size(size);
            return;
        }

        DigestBlob digestBlob = blobShard.blobContainer().createBlob(request.id(), request.transferId());
        digestBlob.addContent(request.content(), request.isLast());

        response.size(digestBlob.size());
        if (request.isLast()) {
            try {
View Full Code Here

Examples of io.crate.blob.v2.BlobShard.blobContainer()

        } catch (InterruptedException | ExecutionException e) {
            throw new TransferRestoreException("failure loading blobShard", request.transferId, e);
        }

        DigestBlob digestBlob = DigestBlob.resumeTransfer(
            blobShard.blobContainer(), transferInfoResponse.digest, request.transferId, request.currentPos
        );

        assert digestBlob != null : "DigestBlob couldn't be restored";

        BlobTransferStatus status;
View Full Code Here

Examples of io.crate.blob.v2.BlobShard.blobContainer()

                content.array(), content.arrayOffset(), content.length()
            );

            if (request.isLast()) {
                transferStatus.outputStream().close();
                File source = new File(shard.blobContainer().getBaseDirectory(),
                    transferStatus.sourcePath()
                );
                File target = new File(shard.blobContainer().getBaseDirectory(),
                    transferStatus.targetPath()
                );
View Full Code Here

Examples of io.crate.blob.v2.BlobShard.blobContainer()

            if (request.isLast()) {
                transferStatus.outputStream().close();
                File source = new File(shard.blobContainer().getBaseDirectory(),
                    transferStatus.sourcePath()
                );
                File target = new File(shard.blobContainer().getBaseDirectory(),
                    transferStatus.targetPath()
                );

                if (target.exists()) {
                    logger.info("target file {} exists already.", target.getName());
View Full Code Here

Examples of io.crate.blob.v2.BlobShard.blobContainer()

            }

            BlobShard shard = status.blobShard;
            String tmpPath = request.path() + "." + request.transferId();
            FileOutputStream outputStream = new FileOutputStream(
                new File(shard.blobContainer().getBaseDirectory(), tmpPath)
            );

            BytesReference content = request.content();
            if (!content.hasArray()) {
                content = content.toBytesArray();
View Full Code Here

Examples of io.crate.blob.v2.BlobShard.blobContainer()

            }
            outputStream.write(content.array(), content.arrayOffset(), content.length());

            if (request.size() == request.content().length()) {  // start request contains the whole file.
                outputStream.close();
                File source = new File(shard.blobContainer().getBaseDirectory(), tmpPath);
                File target = new File(shard.blobContainer().getBaseDirectory(), request.path());
                if (!target.exists()) {
                    if (!source.renameTo(target)) {
                        throw new IllegalBlobRecoveryStateException(
                            "couldn't rename file to " + request.path()
View Full Code Here

Examples of io.crate.blob.v2.BlobShard.blobContainer()

            outputStream.write(content.array(), content.arrayOffset(), content.length());

            if (request.size() == request.content().length()) {  // start request contains the whole file.
                outputStream.close();
                File source = new File(shard.blobContainer().getBaseDirectory(), tmpPath);
                File target = new File(shard.blobContainer().getBaseDirectory(), request.path());
                if (!target.exists()) {
                    if (!source.renameTo(target)) {
                        throw new IllegalBlobRecoveryStateException(
                            "couldn't rename file to " + request.path()
                        );
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.