Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,9 @@ private String parseMetadata(DocumentMetadata metadata) throws IOException {
metadata.setPermString(buf.toString());

// handle quality, always present even if not requested (barrier)
if (item == null) {
throw new IOException("Unexpected null item when reading quality");
}
metadata.setQuality((XSInteger) item.getItem());

// handle metadata
Expand Down Expand Up @@ -625,7 +628,7 @@ public boolean nextKeyValue() throws IOException, InterruptedException {
queryNakedProperties();
int curCount = 0;
while (curCount < nakedCount) {
if (result.hasNext()) {
if (result != null && result.hasNext()) {
result.next();
curCount++;
} else {
Expand All @@ -634,7 +637,7 @@ public boolean nextKeyValue() throws IOException, InterruptedException {
}
}

if (result.hasNext()) {
if (result != null && result.hasNext()) {
ResultItem currItem = null;
currItem = result.next();

Expand Down
7 changes: 4 additions & 3 deletions src/main/java/com/marklogic/contentpump/OutputArchive.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2011-2020 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
* Copyright (c) 2011-2026 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -133,8 +133,9 @@ public void write(String uri, InputStream is, long size,
boolean isExportDoc)
throws IOException {
ZipEntry entry = new ZipEntry(uri);
if (outputStream == null ||
(currentFileBytes + size > Integer.MAX_VALUE) &&
if (outputStream == null) {
newOutputStream();
} else if ((currentFileBytes + size > Integer.MAX_VALUE) &&
currentFileBytes > 0) {
if (currentEntries % 2 == 0 && !isExportDoc) {
//the file overflowed is metadata, create new zip
Expand Down
18 changes: 11 additions & 7 deletions src/main/java/com/marklogic/mapreduce/DatabaseDocument.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2011-2021 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
* Copyright (c) 2011-2026 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -75,13 +75,17 @@ public Text getContentAsText() {
*/
public byte[] getContentAsByteArray() {
if (content == null) {
try {
content = IOHelper.byteArrayFromStream(is);
} catch (IOException e) {
throw new RuntimeException("IOException buffering binary data",
e);
if (is != null) {
try {
content = IOHelper.byteArrayFromStream(is);
} catch (IOException e) {
throw new RuntimeException("IOException buffering binary data",
e);
}
is = null;
} else {
content = new byte[0];
}
is = null;
}
return content;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2011-2021 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
* Copyright (c) 2011-2026 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.

*
* Licensed under the Apache License, Version 2.0 (the "License");
Expand Down Expand Up @@ -223,7 +223,9 @@ protected void getForestSplits(JobContext jobContext,
throw new IOException("Unexpected item " + item.getItemType().toString());
}
String itemStr = ((XSString)item.getItem()).asString();
ruleUris.add(itemStr);
if (ruleUris != null) {
ruleUris.add(itemStr);
}
}

// forest with failover hosts
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2011-2025 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
* Copyright (c) 2011-2026 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -365,6 +365,7 @@ static ContentSource getSecureContentSource(String host, int port,
try {
options = new SecurityOptions(sslOptions.getSslContext());
} catch (KeyManagementException | NoSuchAlgorithmException e) {
LOG.error("Error constructing SecurityOptions", e);
throw new XccConfigException("Error constructing SecurityOptions",
e);
}
Expand Down
Loading