| | |
| | | InitializationException, IOException, JebException, DatabaseException, |
| | | InterruptedException, ExecutionException |
| | | { |
| | | try { |
| | | try |
| | | { |
| | | this.rootContainer = rootContainer; |
| | | this.reader = new LDIFReader(importConfiguration, rootContainer, |
| | | LDIF_READER_BUFFER_SIZE); |
| | |
| | | .getEntriesRejected(), migratedCount, importTime / 1000, rate); |
| | | logError(message); |
| | | } |
| | | catch(Throwable t) { |
| | | System.out.println("here: " + t.getMessage()); |
| | | t.printStackTrace(); |
| | | } |
| | | finally |
| | | { |
| | | reader.close(); |
| | | } |
| | | |
| | | return new LDIFImportResult(reader.getEntriesRead(), reader |
| | | .getEntriesRejected(), reader.getEntriesIgnored()); |
| | | } |
| | |
| | | // This is the base entry for a branch that was excluded in the |
| | | // import so we must migrate all entries in this branch over to |
| | | // the new entry container. |
| | | byte[] end = |
| | | StaticUtils.getBytes("," + excludedDN.toNormalizedString()); |
| | | byte[] end = StaticUtils.getBytes("," + |
| | | excludedDN.toNormalizedString()); |
| | | end[0] = (byte) (end[0] + 1); |
| | | |
| | | while(status == OperationStatus.SUCCESS && |
| | |
| | | } |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | message = |
| | | ERR_JEB_IMPORT_LDIF_MIGRATE_EXCLUDED_TASK_ERR.get(e.getMessage()); |
| | | logError(message); |
| | | throw e; |
| | | } |
| | | finally |
| | | { |
| | | cursor.close(); |
| | |
| | | status = cursor.getSearchKeyRange(key, data, lockMode); |
| | | } |
| | | } |
| | | } finally { |
| | | } |
| | | catch(Exception e) |
| | | { |
| | | message = |
| | | ERR_JEB_IMPORT_LDIF_MIGRATE_EXISTING_TASK_ERR.get(e.getMessage()); |
| | | logError(message); |
| | | throw e; |
| | | } |
| | | finally |
| | | { |
| | | cursor.close(); |
| | | flushIndexBuffers(); |
| | | closeCursors(); |
| | |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | public Void call() throws Exception |
| | | { |
| | | try |
| | | { |
| | | while (true) |
| | | { |
| | | if (importConfiguration.isCancelled()) |
| | |
| | | } |
| | | flushIndexBuffers(); |
| | | closeCursors(); |
| | | } |
| | | catch(Exception e) |
| | | { |
| | | Message message = |
| | | ERR_JEB_IMPORT_LDIF_APPEND_REPLACE_TASK_ERR.get(e.getMessage()); |
| | | logError(message); |
| | | throw e; |
| | | } |
| | | return null; |
| | | } |
| | | |
| | |
| | | */ |
| | | public Void call() throws Exception |
| | | { |
| | | try { |
| | | try |
| | | { |
| | | while (true) |
| | | { |
| | | if (importConfiguration.isCancelled()) |
| | |
| | | } |
| | | flushIndexBuffers(); |
| | | closeCursors(); |
| | | } catch(Throwable t) { |
| | | System.out.println(t.getMessage()); |
| | | t.printStackTrace(); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | Message message = |
| | | ERR_JEB_IMPORT_LDIF_IMPORT_TASK_ERR.get(e.getMessage()); |
| | | logError(message); |
| | | throw e; |
| | | } |
| | | |
| | | return null; |
| | | } |
| | | |
| | |
| | | |
| | | public Void call() throws Exception |
| | | { |
| | | try { |
| | | byte[] cKey = null; |
| | | ImportIDSet cInsertIDSet = null, cDeleteIDSet = null; |
| | | Integer cIndexID = null; |
| | | try |
| | | { |
| | | indexMgr.openIndexFile(); |
| | | SortedSet<Buffer> bufferSet = initializeBuffers(); |
| | | while(!bufferSet.isEmpty()) |
| | |
| | | addToDB(cInsertIDSet, cDeleteIDSet, cIndexID); |
| | | } |
| | | cleanUP(); |
| | | } catch(Throwable t) { |
| | | System.out.println("db here: " + t.getMessage()); |
| | | t.printStackTrace(); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | Message message = |
| | | ERR_JEB_IMPORT_LDIF_INDEX_WRITE_DB_ERR.get(indexMgr.getFileName(), |
| | | e.getMessage()); |
| | | logError(message); |
| | | throw e; |
| | | } |
| | | return null; |
| | | } |
| | |
| | | dataStream.close(); |
| | | indexMgr.setFileLength(); |
| | | } |
| | | catch (IOException e) { |
| | | catch (IOException e) |
| | | { |
| | | Message message = |
| | | ERR_JEB_IMPORT_LDIF_INDEX_FILEWRITER_ERR.get(file.getName(), |
| | | e.getMessage()); |