Skip to content

Commit 0ec4803

Browse files
committed
Merge branch 'trunk' into renameErrorMapping
2 parents 6822054 + 872ebda commit 0ec4803

File tree

385 files changed

+18277
-4302
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

385 files changed

+18277
-4302
lines changed

LICENSE-binary

Lines changed: 33 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -341,20 +341,20 @@ org.apache.solr:solr-solrj:8.11.2
341341
org.apache.yetus:audience-annotations:0.5.0
342342
org.apache.zookeeper:zookeeper:3.8.4
343343
org.codehaus.jettison:jettison:1.5.4
344-
org.eclipse.jetty:jetty-annotations:9.4.53.v20231009
345-
org.eclipse.jetty:jetty-http:9.4.53.v20231009
346-
org.eclipse.jetty:jetty-io:9.4.53.v20231009
347-
org.eclipse.jetty:jetty-jndi:9.4.53.v20231009
348-
org.eclipse.jetty:jetty-plus:9.4.53.v20231009
349-
org.eclipse.jetty:jetty-security:9.4.53.v20231009
350-
org.eclipse.jetty:jetty-server:9.4.53.v20231009
351-
org.eclipse.jetty:jetty-servlet:9.4.53.v20231009
352-
org.eclipse.jetty:jetty-util:9.4.53.v20231009
353-
org.eclipse.jetty:jetty-util-ajax:9.4.53.v20231009
354-
org.eclipse.jetty:jetty-webapp:9.4.53.v20231009
355-
org.eclipse.jetty:jetty-xml:9.4.53.v20231009
356-
org.eclipse.jetty.websocket:javax-websocket-client-impl:9.4.53.v20231009
357-
org.eclipse.jetty.websocket:javax-websocket-server-impl:9.4.53.v20231009
344+
org.eclipse.jetty:jetty-annotations:9.4.57.v20241219
345+
org.eclipse.jetty:jetty-http:9.4.57.v20241219
346+
org.eclipse.jetty:jetty-io:9.4.57.v20241219
347+
org.eclipse.jetty:jetty-jndi:9.4.57.v20241219
348+
org.eclipse.jetty:jetty-plus:9.4.57.v20241219
349+
org.eclipse.jetty:jetty-security:9.4.57.v20241219
350+
org.eclipse.jetty:jetty-server:9.4.57.v20241219
351+
org.eclipse.jetty:jetty-servlet:9.4.57.v20241219
352+
org.eclipse.jetty:jetty-util:9.4.57.v20241219
353+
org.eclipse.jetty:jetty-util-ajax:9.4.57.v20241219
354+
org.eclipse.jetty:jetty-webapp:9.4.57.v20241219
355+
org.eclipse.jetty:jetty-xml:9.4.57.v20241219
356+
org.eclipse.jetty.websocket:javax-websocket-client-impl:9.4.57.v20241219
357+
org.eclipse.jetty.websocket:javax-websocket-server-impl:9.4.57.v20241219
358358
org.ehcache:ehcache:3.8.2
359359
org.ini4j:ini4j:0.5.4
360360
org.lz4:lz4-java:1.7.1
@@ -363,16 +363,6 @@ org.xerial.snappy:snappy-java:1.1.10.4
363363
org.yaml:snakeyaml:2.0
364364
org.wildfly.openssl:wildfly-openssl:2.1.4.Final
365365
software.amazon.awssdk:bundle:2.25.53
366-
org.glassfish.jersey.core:jersey-common:2.46
367-
org.glassfish.jersey.core:jersey-server:2.46
368-
org.glassfish.jersey.inject:jersey-hk2:2.46
369-
org.glassfish.jersey.core:jersey-client:2.46
370-
org.glassfish.jersey.test-framework:jersey-test-framework-core:2.46
371-
org.glassfish.jersey.test-framework.providers:jersey-test-framework-provider-grizzly2:2.46
372-
org.glassfish.jersey.containers:jersey-container-servlet:2.46
373-
org.glassfish.jersey.containers:jersey-container-servlet-core:2.46
374-
org.glassfish.jersey.media:jersey-media-json-jettison:2.46
375-
org.glassfish.jersey.media:jersey-media-jaxb:2.46
376366
net.jodah:failsafe:2.4.4
377367

378368
--------------------------------------------------------------------------------
@@ -405,7 +395,7 @@ hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/static/d3-3.5.17.min.js
405395
leveldb v1.13
406396

407397
com.google.protobuf:protobuf-java:2.5.0
408-
com.google.protobuf:protobuf-java:3.25.3
398+
com.google.protobuf:protobuf-java:3.25.5
409399
com.google.re2j:re2j:1.1
410400
com.jcraft:jsch:0.1.55
411401
com.thoughtworks.paranamer:paranamer:2.3
@@ -535,6 +525,24 @@ jakarta.ws.rs-api:jakarta.ws.rs-api:2.1.6
535525
jakarta.servlet.jsp:jakarta.servlet.jsp-api:2.3.6
536526
jakarta.servlet:jakarta.servlet-api:4.0.4
537527

528+
Eclipse Public License (EPL) 2.0 with some parts being
529+
GNU General Public License (GPL), Version 2, With Classpath Exception,
530+
Apache License, 2.0 or Public Domain
531+
--------------------------
532+
533+
See also https://github.com/eclipse-ee4j/jersey/blob/master/NOTICE.md
534+
535+
org.glassfish.jersey.core:jersey-common:2.46
536+
org.glassfish.jersey.core:jersey-server:2.46
537+
org.glassfish.jersey.inject:jersey-hk2:2.46
538+
org.glassfish.jersey.core:jersey-client:2.46
539+
org.glassfish.jersey.test-framework:jersey-test-framework-core:2.46
540+
org.glassfish.jersey.test-framework.providers:jersey-test-framework-provider-grizzly2:2.46
541+
org.glassfish.jersey.containers:jersey-container-servlet:2.46
542+
org.glassfish.jersey.containers:jersey-container-servlet-core:2.46
543+
org.glassfish.jersey.media:jersey-media-json-jettison:2.46
544+
org.glassfish.jersey.media:jersey-media-jaxb:2.46
545+
538546

539547
HSQL License
540548
------------

hadoop-common-project/hadoop-common/pom.xml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,26 @@
381381
<artifactId>lz4-java</artifactId>
382382
<scope>provided</scope>
383383
</dependency>
384+
<dependency>
385+
<groupId>org.junit.jupiter</groupId>
386+
<artifactId>junit-jupiter-api</artifactId>
387+
<scope>test</scope>
388+
</dependency>
389+
<dependency>
390+
<groupId>org.junit.jupiter</groupId>
391+
<artifactId>junit-jupiter-engine</artifactId>
392+
<scope>test</scope>
393+
</dependency>
394+
<dependency>
395+
<groupId>org.junit.jupiter</groupId>
396+
<artifactId>junit-jupiter-params</artifactId>
397+
<scope>test</scope>
398+
</dependency>
399+
<dependency>
400+
<groupId>org.junit.platform</groupId>
401+
<artifactId>junit-platform-launcher</artifactId>
402+
<scope>test</scope>
403+
</dependency>
384404
</dependencies>
385405

386406
<build>

hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/shell/Display.java

Lines changed: 140 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -215,12 +215,12 @@ protected void processPath(PathData item) throws IOException {
215215
}
216216

217217
protected class TextRecordInputStream extends InputStream {
218-
SequenceFile.Reader r;
219-
Object key;
220-
Object val;
218+
private final SequenceFile.Reader r;
219+
private Object key;
220+
private Object val;
221221

222-
DataInputBuffer inbuf;
223-
DataOutputBuffer outbuf;
222+
private final DataInputBuffer inbuf;
223+
private final DataOutputBuffer outbuf;
224224

225225
public TextRecordInputStream(FileStatus f) throws IOException {
226226
final Path fpath = f.getPath();
@@ -237,30 +237,67 @@ public TextRecordInputStream(FileStatus f) throws IOException {
237237
public int read() throws IOException {
238238
int ret;
239239
if (null == inbuf || -1 == (ret = inbuf.read())) {
240-
key = r.next(key);
241-
if (key == null) {
242-
return -1;
240+
if (!readNextFromSequenceFile()) {
241+
ret = -1;
243242
} else {
244-
val = r.getCurrentValue(val);
243+
ret = inbuf.read();
245244
}
246-
byte[] tmp = key.toString().getBytes(StandardCharsets.UTF_8);
247-
outbuf.write(tmp, 0, tmp.length);
248-
outbuf.write('\t');
249-
tmp = val.toString().getBytes(StandardCharsets.UTF_8);
250-
outbuf.write(tmp, 0, tmp.length);
251-
outbuf.write('\n');
252-
inbuf.reset(outbuf.getData(), outbuf.getLength());
253-
outbuf.reset();
254-
ret = inbuf.read();
255245
}
256246
return ret;
257247
}
258248

249+
@Override
250+
public int read(byte[] dest, int destPos, int destLen) throws IOException {
251+
validateInputStreamReadArguments(dest, destPos, destLen);
252+
253+
if (destLen == 0) {
254+
return 0;
255+
}
256+
257+
int bytesRead = 0;
258+
while (destLen > 0) {
259+
// Attempt to copy buffered data.
260+
int copyLen = inbuf.read(dest, destPos, destLen);
261+
if (-1 == copyLen) {
262+
// There was no buffered data.
263+
if (!readNextFromSequenceFile()) {
264+
// There is also no data remaining in the file.
265+
break;
266+
}
267+
// Reattempt copy now that we have buffered data.
268+
copyLen = inbuf.read(dest, destPos, destLen);
269+
}
270+
bytesRead += copyLen;
271+
destPos += copyLen;
272+
destLen -= copyLen;
273+
}
274+
275+
return bytesRead > 0 ? bytesRead : -1;
276+
}
277+
259278
@Override
260279
public void close() throws IOException {
261280
r.close();
262281
super.close();
263282
}
283+
284+
private boolean readNextFromSequenceFile() throws IOException {
285+
key = r.next(key);
286+
if (key == null) {
287+
return false;
288+
} else {
289+
val = r.getCurrentValue(val);
290+
}
291+
byte[] tmp = key.toString().getBytes(StandardCharsets.UTF_8);
292+
outbuf.write(tmp, 0, tmp.length);
293+
outbuf.write('\t');
294+
tmp = val.toString().getBytes(StandardCharsets.UTF_8);
295+
outbuf.write(tmp, 0, tmp.length);
296+
outbuf.write('\n');
297+
inbuf.reset(outbuf.getData(), outbuf.getLength());
298+
outbuf.reset();
299+
return true;
300+
}
264301
}
265302

266303
/**
@@ -270,10 +307,11 @@ public void close() throws IOException {
270307
protected static class AvroFileInputStream extends InputStream {
271308
private int pos;
272309
private byte[] buffer;
273-
private ByteArrayOutputStream output;
274-
private FileReader<?> fileReader;
275-
private DatumWriter<Object> writer;
276-
private JsonEncoder encoder;
310+
private final ByteArrayOutputStream output;
311+
private final FileReader<?> fileReader;
312+
private final DatumWriter<Object> writer;
313+
private final JsonEncoder encoder;
314+
private final byte[] finalSeparator;
277315

278316
public AvroFileInputStream(FileStatus status) throws IOException {
279317
pos = 0;
@@ -286,31 +324,96 @@ public AvroFileInputStream(FileStatus status) throws IOException {
286324
writer = new GenericDatumWriter<Object>(schema);
287325
output = new ByteArrayOutputStream();
288326
encoder = EncoderFactory.get().jsonEncoder(schema, output);
327+
finalSeparator = System.getProperty("line.separator").getBytes(StandardCharsets.UTF_8);
289328
}
290329

291330
/**
292331
* Read a single byte from the stream.
293332
*/
294333
@Override
295334
public int read() throws IOException {
335+
if (buffer == null) {
336+
return -1;
337+
}
338+
296339
if (pos < buffer.length) {
297340
return buffer[pos++];
298341
}
342+
299343
if (!fileReader.hasNext()) {
344+
// Unset buffer to signal EOF on future calls.
345+
buffer = null;
300346
return -1;
301347
}
348+
302349
writer.write(fileReader.next(), encoder);
303350
encoder.flush();
351+
304352
if (!fileReader.hasNext()) {
305-
// Write a new line after the last Avro record.
306-
output.write(System.getProperty("line.separator")
307-
.getBytes(StandardCharsets.UTF_8));
308-
output.flush();
353+
if (buffer.length > 0) {
354+
// Write a new line after the last Avro record.
355+
output.write(finalSeparator);
356+
output.flush();
357+
}
309358
}
359+
360+
swapBuffer();
361+
return read();
362+
}
363+
364+
@Override
365+
public int read(byte[] dest, int destPos, int destLen) throws IOException {
366+
validateInputStreamReadArguments(dest, destPos, destLen);
367+
368+
if (destLen == 0) {
369+
return 0;
370+
}
371+
372+
if (buffer == null) {
373+
return -1;
374+
}
375+
376+
int bytesRead = 0;
377+
while (destLen > 0 && buffer != null) {
378+
if (pos < buffer.length) {
379+
// We have buffered data available, either from the Avro file or the final separator.
380+
int copyLen = Math.min(buffer.length - pos, destLen);
381+
System.arraycopy(buffer, pos, dest, destPos, copyLen);
382+
pos += copyLen;
383+
bytesRead += copyLen;
384+
destPos += copyLen;
385+
destLen -= copyLen;
386+
} else if (buffer == finalSeparator) {
387+
// There is no buffered data, and the last buffer processed was the final separator.
388+
// Unset buffer to signal EOF on future calls.
389+
buffer = null;
390+
} else if (!fileReader.hasNext()) {
391+
if (buffer.length > 0) {
392+
// There is no data remaining in the file. Get ready to write the final separator on
393+
// the next iteration.
394+
buffer = finalSeparator;
395+
pos = 0;
396+
} else {
397+
// We never read data into the buffer. This must be an empty file.
398+
// Immediate EOF, no separator needed.
399+
buffer = null;
400+
return -1;
401+
}
402+
} else {
403+
// Read the next data from the file into the buffer.
404+
writer.write(fileReader.next(), encoder);
405+
encoder.flush();
406+
swapBuffer();
407+
}
408+
}
409+
410+
return bytesRead;
411+
}
412+
413+
private void swapBuffer() {
310414
pos = 0;
311415
buffer = output.toByteArray();
312416
output.reset();
313-
return read();
314417
}
315418

316419
/**
@@ -323,4 +426,14 @@ public void close() throws IOException {
323426
super.close();
324427
}
325428
}
429+
430+
private static void validateInputStreamReadArguments(byte[] dest, int destPos, int destLen)
431+
throws IOException {
432+
if (dest == null) {
433+
throw new NullPointerException("null destination buffer");
434+
} else if (destPos < 0 || destLen < 0 || destLen > dest.length - destPos) {
435+
throw new IndexOutOfBoundsException(String.format(
436+
"invalid destination buffer range: destPos = %d, destLen = %d", destPos, destLen));
437+
}
438+
}
326439
}

hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/UGIExceptionMessages.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ final class UGIExceptionMessages {
2727
public static final String FOR_USER = " for user: ";
2828
public static final String FOR_PRINCIPAL = " for principal: ";
2929
public static final String FROM_KEYTAB = " from keytab ";
30+
public static final String INVALID_UID = "Invalid UID, could not determine effective user";
3031
public static final String LOGIN_FAILURE = "Login failure";
3132
public static final String LOGOUT_FAILURE = "Logout failure";
3233
public static final String MUST_FIRST_LOGIN =

hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/UserGroupInformation.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2075,6 +2075,12 @@ private static UserGroupInformation doSubjectLogin(
20752075
}
20762076
return ugi;
20772077
} catch (LoginException le) {
2078+
String msg = le.getMessage();
2079+
if (msg != null && msg.contains("invalid null input")) {
2080+
// This error from the JDK indicates that the OS couldn't map the UID of this process to an
2081+
// actual user. Throw this as an IOException, because it's not related to Kerberos.
2082+
throw new IOException(INVALID_UID, le);
2083+
}
20782084
KerberosAuthException kae =
20792085
new KerberosAuthException(FAILURE_TO_LOGIN, le);
20802086
if (params != null) {

0 commit comments

Comments
 (0)