Tabnine Logo
CacheableIPList.<init>
Code IndexAdd Tabnine to your IDE (free)

How to use
org.apache.hadoop.util.CacheableIPList
constructor

Best Java code snippets using org.apache.hadoop.util.CacheableIPList.<init> (Showing top 14 results out of 315)

origin: org.apache.hadoop/hadoop-common

public CombinedIPList(String fixedBlackListFile,
  String variableBlackListFile, long cacheExpiryInSeconds) {
 IPList fixedNetworkList = new FileBasedIPList(fixedBlackListFile);
 if (variableBlackListFile != null) {
  IPList variableNetworkList = new CacheableIPList(
    new FileBasedIPList(variableBlackListFile), cacheExpiryInSeconds);
  networkLists = new IPList[]{fixedNetworkList, variableNetworkList};
 } else {
  networkLists = new IPList[]{fixedNetworkList};
 }
}
origin: org.apache.hadoop/hadoop-common

public CombinedIPWhiteList(String fixedWhiteListFile,
  String variableWhiteListFile, long cacheExpiryInSeconds) {
 IPList fixedNetworkList = new FileBasedIPList(fixedWhiteListFile);
 if (variableWhiteListFile != null){
  IPList variableNetworkList = new CacheableIPList(
    new FileBasedIPList(variableWhiteListFile),cacheExpiryInSeconds);
  networkLists = new IPList[] {fixedNetworkList, variableNetworkList};
 }
 else {
  networkLists = new IPList[] {fixedNetworkList};
 }
}
@Override
origin: ch.cern.hadoop/hadoop-common

public CombinedIPWhiteList(String fixedWhiteListFile,
  String variableWhiteListFile, long cacheExpiryInSeconds) {
 IPList fixedNetworkList = new FileBasedIPList(fixedWhiteListFile);
 if (variableWhiteListFile != null){
  IPList variableNetworkList = new CacheableIPList(
    new FileBasedIPList(variableWhiteListFile),cacheExpiryInSeconds);
  networkLists = new IPList[] {fixedNetworkList, variableNetworkList};
 }
 else {
  networkLists = new IPList[] {fixedNetworkList};
 }
}
@Override
origin: io.hops/hadoop-common

public CombinedIPWhiteList(String fixedWhiteListFile,
  String variableWhiteListFile, long cacheExpiryInSeconds) {
 IPList fixedNetworkList = new FileBasedIPList(fixedWhiteListFile);
 if (variableWhiteListFile != null){
  IPList variableNetworkList = new CacheableIPList(
    new FileBasedIPList(variableWhiteListFile),cacheExpiryInSeconds);
  networkLists = new IPList[] {fixedNetworkList, variableNetworkList};
 }
 else {
  networkLists = new IPList[] {fixedNetworkList};
 }
}
@Override
origin: com.github.jiayuhan-it/hadoop-common

public CombinedIPWhiteList(String fixedWhiteListFile,
  String variableWhiteListFile, long cacheExpiryInSeconds) {
 IPList fixedNetworkList = new FileBasedIPList(fixedWhiteListFile);
 if (variableWhiteListFile != null){
  IPList variableNetworkList = new CacheableIPList(
    new FileBasedIPList(variableWhiteListFile),cacheExpiryInSeconds);
  networkLists = new IPList[] {fixedNetworkList, variableNetworkList};
 }
 else {
  networkLists = new IPList[] {fixedNetworkList};
 }
}
@Override
origin: io.prestosql.hadoop/hadoop-apache

public CombinedIPWhiteList(String fixedWhiteListFile,
  String variableWhiteListFile, long cacheExpiryInSeconds) {
 IPList fixedNetworkList = new FileBasedIPList(fixedWhiteListFile);
 if (variableWhiteListFile != null){
  IPList variableNetworkList = new CacheableIPList(
    new FileBasedIPList(variableWhiteListFile),cacheExpiryInSeconds);
  networkLists = new IPList[] {fixedNetworkList, variableNetworkList};
 }
 else {
  networkLists = new IPList[] {fixedNetworkList};
 }
}
@Override
origin: ch.cern.hadoop/hadoop-common

/**
 * Add a bunch of subnets and IPSs to the file
 * setup a low cache refresh
 * test for inclusion
 * Check for exclusion
 * Remove a bunch of subnets and Ips
 * wait for cache timeout.
 * test for inclusion
 * Check for exclusion
 */
public void testRemovalWithSleepForCacheTimeout() throws IOException, InterruptedException {
 String[] ips = {"10.119.103.112", "10.221.102.0/23",
   "10.222.0.0/16", "10.113.221.221", "10.113.221.222"};
 TestFileBasedIPList.createFileWithEntries ("ips.txt", ips);
 CacheableIPList cipl = new CacheableIPList(
   new FileBasedIPList("ips.txt"),100);
 assertTrue("10.113.221.222 is not in the list",
   cipl.isIn("10.113.221.222"));
 assertTrue ("10.222.103.121 is not in the list",
   cipl.isIn("10.222.103.121"));
 TestFileBasedIPList.removeFile("ips.txt");
 String[]ips2 = {"10.119.103.112", "10.221.102.0/23", "10.113.221.221"};
 TestFileBasedIPList.createFileWithEntries ("ips.txt", ips2);
 Thread.sleep(1005);
 assertFalse("10.113.221.222 is in the list",
   cipl.isIn("10.113.221.222"));
 assertFalse ("10.222.103.121 is  in the list",
   cipl.isIn("10.222.103.121"));
 TestFileBasedIPList.removeFile("ips.txt");
}
origin: ch.cern.hadoop/hadoop-common

/**
 * Add a bunch of subnets and IPSs to the file
 * setup a low cache refresh
 * test for inclusion
 * Check for exclusion
 * Add a bunch of subnets and Ips
 * wait for cache timeout.
 * test for inclusion
 * Check for exclusion
 */
public void testAddWithSleepForCacheTimeout() throws IOException, InterruptedException {
 String[] ips = {"10.119.103.112", "10.221.102.0/23", "10.113.221.221"};
 TestFileBasedIPList.createFileWithEntries ("ips.txt", ips);
 CacheableIPList cipl = new CacheableIPList(
   new FileBasedIPList("ips.txt"),100);
 assertFalse("10.113.221.222 is in the list",
   cipl.isIn("10.113.221.222"));
 assertFalse ("10.222.103.121 is  in the list",
   cipl.isIn("10.222.103.121"));
 TestFileBasedIPList.removeFile("ips.txt");
 String[]ips2 = {"10.119.103.112", "10.221.102.0/23",
   "10.222.0.0/16", "10.113.221.221", "10.113.221.222"};
 TestFileBasedIPList.createFileWithEntries ("ips.txt", ips2);
 Thread.sleep(101);
 assertTrue("10.113.221.222 is not in the list",
   cipl.isIn("10.113.221.222"));
 assertTrue ("10.222.103.121 is not in the list",
   cipl.isIn("10.222.103.121"));
 TestFileBasedIPList.removeFile("ips.txt");
}
origin: com.github.jiayuhan-it/hadoop-common

/**
 * Add a bunch of subnets and IPSs to the file
 * setup a low cache refresh
 * test for inclusion
 * Check for exclusion
 * Add a bunch of subnets and Ips
 * wait for cache timeout.
 * test for inclusion
 * Check for exclusion
 */
public void testAddWithSleepForCacheTimeout() throws IOException, InterruptedException {
 String[] ips = {"10.119.103.112", "10.221.102.0/23", "10.113.221.221"};
 TestFileBasedIPList.createFileWithEntries ("ips.txt", ips);
 CacheableIPList cipl = new CacheableIPList(
   new FileBasedIPList("ips.txt"),100);
 assertFalse("10.113.221.222 is in the list",
   cipl.isIn("10.113.221.222"));
 assertFalse ("10.222.103.121 is  in the list",
   cipl.isIn("10.222.103.121"));
 TestFileBasedIPList.removeFile("ips.txt");
 String[]ips2 = {"10.119.103.112", "10.221.102.0/23",
   "10.222.0.0/16", "10.113.221.221", "10.113.221.222"};
 TestFileBasedIPList.createFileWithEntries ("ips.txt", ips2);
 Thread.sleep(101);
 assertTrue("10.113.221.222 is not in the list",
   cipl.isIn("10.113.221.222"));
 assertTrue ("10.222.103.121 is not in the list",
   cipl.isIn("10.222.103.121"));
 TestFileBasedIPList.removeFile("ips.txt");
}
origin: com.github.jiayuhan-it/hadoop-common

/**
 * Add a bunch of subnets and IPSs to the file
 * setup a low cache refresh
 * test for inclusion
 * Check for exclusion
 * Remove a bunch of subnets and Ips
 * wait for cache timeout.
 * test for inclusion
 * Check for exclusion
 */
public void testRemovalWithSleepForCacheTimeout() throws IOException, InterruptedException {
 String[] ips = {"10.119.103.112", "10.221.102.0/23",
   "10.222.0.0/16", "10.113.221.221", "10.113.221.222"};
 TestFileBasedIPList.createFileWithEntries ("ips.txt", ips);
 CacheableIPList cipl = new CacheableIPList(
   new FileBasedIPList("ips.txt"),100);
 assertTrue("10.113.221.222 is not in the list",
   cipl.isIn("10.113.221.222"));
 assertTrue ("10.222.103.121 is not in the list",
   cipl.isIn("10.222.103.121"));
 TestFileBasedIPList.removeFile("ips.txt");
 String[]ips2 = {"10.119.103.112", "10.221.102.0/23", "10.113.221.221"};
 TestFileBasedIPList.createFileWithEntries ("ips.txt", ips2);
 Thread.sleep(1005);
 assertFalse("10.113.221.222 is in the list",
   cipl.isIn("10.113.221.222"));
 assertFalse ("10.222.103.121 is  in the list",
   cipl.isIn("10.222.103.121"));
 TestFileBasedIPList.removeFile("ips.txt");
}
origin: ch.cern.hadoop/hadoop-common

/**
 * Add a bunch of subnets and IPSs to the file
 * setup a low cache refresh
 * test for inclusion
 * Check for exclusion
 * Remove a bunch of subnets and Ips
 * wait for cache timeout.
 * test for inclusion
 * Check for exclusion
 */
public void testRemovalWithRefresh() throws IOException, InterruptedException {
 String[] ips = {"10.119.103.112", "10.221.102.0/23",
   "10.222.0.0/16", "10.113.221.221", "10.113.221.222"};
 TestFileBasedIPList.createFileWithEntries ("ips.txt", ips);
 CacheableIPList cipl = new CacheableIPList(
   new FileBasedIPList("ips.txt"),100);
 assertTrue("10.113.221.222 is not in the list",
   cipl.isIn("10.113.221.222"));
 assertTrue ("10.222.103.121 is not in the list",
   cipl.isIn("10.222.103.121"));
 TestFileBasedIPList.removeFile("ips.txt");
 String[]ips2 = {"10.119.103.112", "10.221.102.0/23", "10.113.221.221"};
 TestFileBasedIPList.createFileWithEntries ("ips.txt", ips2);
 cipl.refresh();
 assertFalse("10.113.221.222 is in the list",
   cipl.isIn("10.113.221.222"));
 assertFalse ("10.222.103.121 is  in the list",
   cipl.isIn("10.222.103.121"));
 TestFileBasedIPList.removeFile("ips.txt");
}
origin: com.github.jiayuhan-it/hadoop-common

/**
 * Add a bunch of subnets and IPSs to the file
 * setup a low cache refresh
 * test for inclusion
 * Check for exclusion
 * Remove a bunch of subnets and Ips
 * wait for cache timeout.
 * test for inclusion
 * Check for exclusion
 */
public void testRemovalWithRefresh() throws IOException, InterruptedException {
 String[] ips = {"10.119.103.112", "10.221.102.0/23",
   "10.222.0.0/16", "10.113.221.221", "10.113.221.222"};
 TestFileBasedIPList.createFileWithEntries ("ips.txt", ips);
 CacheableIPList cipl = new CacheableIPList(
   new FileBasedIPList("ips.txt"),100);
 assertTrue("10.113.221.222 is not in the list",
   cipl.isIn("10.113.221.222"));
 assertTrue ("10.222.103.121 is not in the list",
   cipl.isIn("10.222.103.121"));
 TestFileBasedIPList.removeFile("ips.txt");
 String[]ips2 = {"10.119.103.112", "10.221.102.0/23", "10.113.221.221"};
 TestFileBasedIPList.createFileWithEntries ("ips.txt", ips2);
 cipl.refresh();
 assertFalse("10.113.221.222 is in the list",
   cipl.isIn("10.113.221.222"));
 assertFalse ("10.222.103.121 is  in the list",
   cipl.isIn("10.222.103.121"));
 TestFileBasedIPList.removeFile("ips.txt");
}
origin: ch.cern.hadoop/hadoop-common

/**
 * Add a bunch of subnets and IPSs to the file
 * setup a low cache refresh
 * test for inclusion
 * Check for exclusion
 * Add a bunch of subnets and Ips
 * do a refresh
 * test for inclusion
 * Check for exclusion
 */
public void testAddWithRefresh() throws IOException, InterruptedException {
 String[] ips = {"10.119.103.112", "10.221.102.0/23", "10.113.221.221"};
 TestFileBasedIPList.createFileWithEntries ("ips.txt", ips);
 CacheableIPList cipl = new CacheableIPList(
   new FileBasedIPList("ips.txt"),100);
 assertFalse("10.113.221.222 is in the list",
   cipl.isIn("10.113.221.222"));
 assertFalse ("10.222.103.121 is  in the list",
   cipl.isIn("10.222.103.121"));
 TestFileBasedIPList.removeFile("ips.txt");
 String[]ips2 = {"10.119.103.112", "10.221.102.0/23",
   "10.222.0.0/16", "10.113.221.221", "10.113.221.222"};
 TestFileBasedIPList.createFileWithEntries ("ips.txt", ips2);
 cipl.refresh();
 assertTrue("10.113.221.222 is not in the list",
   cipl.isIn("10.113.221.222"));
 assertTrue ("10.222.103.121 is not in the list",
   cipl.isIn("10.222.103.121"));
 TestFileBasedIPList.removeFile("ips.txt");
}
origin: com.github.jiayuhan-it/hadoop-common

/**
 * Add a bunch of subnets and IPSs to the file
 * setup a low cache refresh
 * test for inclusion
 * Check for exclusion
 * Add a bunch of subnets and Ips
 * do a refresh
 * test for inclusion
 * Check for exclusion
 */
public void testAddWithRefresh() throws IOException, InterruptedException {
 String[] ips = {"10.119.103.112", "10.221.102.0/23", "10.113.221.221"};
 TestFileBasedIPList.createFileWithEntries ("ips.txt", ips);
 CacheableIPList cipl = new CacheableIPList(
   new FileBasedIPList("ips.txt"),100);
 assertFalse("10.113.221.222 is in the list",
   cipl.isIn("10.113.221.222"));
 assertFalse ("10.222.103.121 is  in the list",
   cipl.isIn("10.222.103.121"));
 TestFileBasedIPList.removeFile("ips.txt");
 String[]ips2 = {"10.119.103.112", "10.221.102.0/23",
   "10.222.0.0/16", "10.113.221.221", "10.113.221.222"};
 TestFileBasedIPList.createFileWithEntries ("ips.txt", ips2);
 cipl.refresh();
 assertTrue("10.113.221.222 is not in the list",
   cipl.isIn("10.113.221.222"));
 assertTrue ("10.222.103.121 is not in the list",
   cipl.isIn("10.222.103.121"));
 TestFileBasedIPList.removeFile("ips.txt");
}
org.apache.hadoop.utilCacheableIPList<init>

Popular methods of CacheableIPList

  • reset
    Reloads the ip list
  • updateCacheExpiryTime
  • isIn
  • refresh
    Refreshes the ip list

Popular in Java

  • Updating database using SQL prepared statement
  • getContentResolver (Context)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • getExternalFilesDir (Context)
  • Component (java.awt)
    A component is an object having a graphical representation that can be displayed on the screen and t
  • NumberFormat (java.text)
    The abstract base class for all number formats. This class provides the interface for formatting and
  • LinkedHashMap (java.util)
    LinkedHashMap is an implementation of Map that guarantees iteration order. All optional operations a
  • StringTokenizer (java.util)
    Breaks a string into tokens; new code should probably use String#split.> // Legacy code: StringTo
  • IsNull (org.hamcrest.core)
    Is the value null?
  • Table (org.hibernate.mapping)
    A relational table
  • Top Vim plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now