Package org.lilyproject.repository.api

Examples of org.lilyproject.repository.api.BlobException


        blobKey = Bytes.add(blobKey, Bytes.toBytes(uuid.getLeastSignificantBits()));
        FSDataOutputStream fsDataOutputStream;
        try {
            fsDataOutputStream = fileSystem.create(createPath(uuid));
        } catch (IOException e) {
            throw new BlobException("Failed to open an outputstream for blob '" + blob + "' on the DFS blobstore", e);
        }
        return new DFSBlobOutputStream(fsDataOutputStream, blobKey, blob);
    }
View Full Code Here


    public InputStream getInputStream(byte[] blobKey) throws BlobException {
        UUID uuid = decode(blobKey);
        try {
            return fileSystem.open(createPath(uuid));
        } catch (IOException e) {
            throw new BlobException("Failed to open an inputstream for blobkey '" + Hex.encodeHexString(blobKey) + "' on the DFS blobstore", e);
        }
    }
View Full Code Here

    public void delete(byte[] blobKey) throws BlobException {
        UUID uuid = decode(blobKey);
        try {
            fileSystem.delete(createPath(uuid), false);
        } catch (IOException e) {
            throw new BlobException("Failed to delete blob with key '" + Hex.encodeHexString(blobKey) +"' from the DFS blobstore", e);
        }
    }
View Full Code Here

        }
        Pair<String, byte[]> decodedKey;
        try {
            decodedKey = decode(blob.getValue());
        } catch (Exception e) {
            throw new BlobException("Failed to decode the blobkey of the blob '" + blob + "'", e);
        }
        return decodedKey;
    }
View Full Code Here

    @Override
    public BlobAccess getBlobAccess(Record record, QName fieldName, FieldType fieldType, int...indexes)
            throws BlobException {
        if (!(fieldType.getValueType().getDeepestValueType() instanceof BlobValueType)) {
            throw new BlobException("Cannot read a blob from a non-blob field type: " + fieldType.getName());
        }

        Blob blob = getBlobFromRecord(record, fieldName, fieldType, indexes);
        return registry.getBlobAccess(blob);
    }
View Full Code Here

        get.addColumn(BLOBS_COLUMN_FAMILY_BYTES, BLOB_COLUMN);
        Result result;
        try {
            result = table.get(get);
        } catch (IOException e) {
            throw new BlobException("Failed to open an inputstream for blobkey '" + Hex.encodeHexString(blobKey) + "' on the HBASE blobstore", e);
        }
        byte[] value = result.getValue(BLOBS_COLUMN_FAMILY_BYTES, BLOB_COLUMN);
        if (value == null) {
            throw new BlobException("Failed to open an inputstream for blobkey '" + Hex.encodeHexString(blobKey) + "' since no blob was found on the HBASE blobstore");
        }
        return new ByteArrayInputStream(value);
    }
View Full Code Here

    public void delete(byte[] blobKey) throws BlobException {
        Delete delete = new Delete(blobKey);
        try {
            table.delete(delete);
        } catch (IOException e) {
            throw new BlobException("Failed to delete blob with key '" + Hex.encodeHexString(blobKey) + "' from the DFS blobstore", e);
        }
    }
View Full Code Here

TOP

Related Classes of org.lilyproject.repository.api.BlobException

Copyright © 2018 www.massapicom. 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.