Github user advancedxy commented on the pull request:
https://github.com/apache/spark/pull/1946#issuecomment-52382756
@pwendell @mridulm no, this behavior is not documented. The java SE doc
doesn't say anything about ordering.. So before filing the JIRA, I looked up
the OpenJDK source code, both 6 and 7.
Maybe I should post some snippets here.
In openjdk-6-src-b27,
jdk/src/windows/native/java/net/NetworkInterface.c Line335-
```
/*
* Put the interface at tail of list as GetIfTable(,,TRUE) is
* returning the interfaces in index order.
*/
count++;
if (netifP == NULL) {
netifP = curr;
} else {
netif *tail = netifP;
while (tail->next != NULL) {
tail = tail->next;
}
tail->next = curr;
}
```
jdk/src/solaris/native/java/net/NetworkInterface.c function *addif Line1000
```
/*
* If "new" then create an netif structure and
* insert it onto the list.
*/
if (currif == NULL) {
currif = (netif *)malloc(sizeof(netif));
if (currif) {
currif->name = strdup(name);
if (currif->name == NULL) {
free(currif);
currif = NULL;
}
}
if (currif == NULL) {
JNU_ThrowOutOfMemoryError(env, "heap allocation failed");
return ifs;
}
currif->index = index;
currif->addr = NULL;
currif->childs = NULL;
currif->virtual = isVirtual;
currif->next = ifs;
ifs = currif;
}
```
Of course, the whole flow is more complicated, but you can get the idea.
Source code in OpenJDk7 is similar, I won't post it here as this is a long
comment.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]