org.apache.hadoop.util
Class MachineList
java.lang.Object
org.apache.hadoop.util.MachineList
public class MachineList
- extends Object
Container class which holds a list of ip/host addresses and
answers membership queries.
Accepts list of ip addresses, ip addreses in CIDR format and/or
host addresses.
Field Summary |
static org.apache.commons.logging.Log |
LOG
|
Method Summary |
Collection<String> |
getCollection()
returns the contents of the MachineList as a Collection
This can be used for testing |
boolean |
includes(String ipAddress)
Accepts an ip address and return true if ipAddress is in the list |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LOG
public static final org.apache.commons.logging.Log LOG
MachineList
public MachineList(String hostEntries)
- Parameters:
hostEntries
- comma separated ip/cidr/host addresses
MachineList
public MachineList(Collection<String> hostEntries)
- Parameters:
hostEntries
- collection of separated ip/cidr/host addresses
MachineList
public MachineList(Collection<String> hostEntries,
MachineList.InetAddressFactory addressFactory)
- Accepts a collection of ip/cidr/host addresses
- Parameters:
hostEntries
- addressFactory
- addressFactory to convert host to InetAddress
includes
public boolean includes(String ipAddress)
- Accepts an ip address and return true if ipAddress is in the list
- Parameters:
ipAddress
-
- Returns:
- true if ipAddress is part of the list
getCollection
public Collection<String> getCollection()
- returns the contents of the MachineList as a Collection
This can be used for testing
- Returns:
- contents of the MachineList
Copyright © 2014 Apache Software Foundation. All Rights Reserved.