Package com.asakusafw.bulkloader.transfer

Examples of com.asakusafw.bulkloader.transfer.FileProtocol


                        model.__tgc__DataModelVersion());

                FileProtocol.Kind kind = startTimestamp == null
                    ? FileProtocol.Kind.CREATE_CACHE
                    : FileProtocol.Kind.UPDATE_CACHE;
                FileProtocol protocol = new FileProtocol(kind, tableInfo.getDfsFilePath(), nextRemoteInfo);
                tableInfo.setImportProtocol(protocol);
            }
            succeed = true;
        } finally {
            if (succeed == false) {
View Full Code Here


    private void setContentProtocol(String tableName, ImportTargetTableBean table) {
        assert tableName != null;
        assert table != null;
        String remoteLocation = FileNameUtil.createSendImportFileName(tableName);
        FileProtocol protocol = new FileProtocol(FileProtocol.Kind.CONTENT, remoteLocation, null);
        table.setImportProtocol(protocol);
    }
View Full Code Here

                    for (String tableName : bean.getImportTargetTableList()) {
                        ImportTargetTableBean table = bean.getTargetTable(tableName);
                        if (table.getCacheId() == null || table.getDfsFilePath() == null) {
                            continue;
                        }
                        FileProtocol protocol = new FileProtocol(
                                FileProtocol.Kind.GET_CACHE_INFO,
                                table.getDfsFilePath(),
                                null);

                        // send only header
View Full Code Here

            public Map<String, CacheInfo> call() throws IOException {
                Map<String, CacheInfo> results = new HashMap<String, CacheInfo>();
                FileList.Reader reader = provider.openReader();
                try {
                    while (reader.next()) {
                        FileProtocol protocol = reader.getCurrentProtocol();

                        // receive only header
                        reader.openContent().close();

                        if (protocol.getKind() == FileProtocol.Kind.RESPONSE_CACHE_INFO) {
                            assert protocol.getInfo() != null;
                            results.put(protocol.getLocation(), protocol.getInfo());
                        } else if (protocol.getKind() != FileProtocol.Kind.RESPONSE_NOT_FOUND
                                && protocol.getKind() != FileProtocol.Kind.RESPONSE_ERROR) {
                            throw new IOException(MessageFormat.format(
                                    "Unknown protocol in response: {0}",
                                    protocol));
                        }
                    }
View Full Code Here

        byte[] buf = new byte[buffSize];
        long dumpFileSize = 0;
        try {
            InputStream input = new FileInputStream(localFile);
            try {
                FileProtocol protocol = targetTable.getImportProtocol();
                assert protocol != null;
                OutputStream output = writer.openNext(protocol);
                try {
                    while (true) {
                        int read = input.read(buf);
View Full Code Here

TOP

Related Classes of com.asakusafw.bulkloader.transfer.FileProtocol

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.