public class DbSearcher extends Object
| Modifier and Type | Field and Description |
|---|---|
static int |
BINARY_ALGORITHM |
static int |
BTREE_ALGORITHM |
static int |
MEMORY_ALGORITYM |
| Constructor and Description |
|---|
DbSearcher(DbConfig dbConfig,
String dbFile)
construct class
|
| Modifier and Type | Method and Description |
|---|---|
DataBlock |
binarySearch(long ip)
get the region with a int ip address with binary search algorithm
|
DataBlock |
binarySearch(String ip)
get the region throught the ip address with binary search algorithm
|
DataBlock |
btreeSearch(long ip)
get the region with a int ip address with b-tree algorithm
|
DataBlock |
btreeSearch(String ip)
get the region throught the ip address with b-tree search algorithm
|
void |
close()
close the db
|
DataBlock |
getByIndexPtr(long ptr)
get by index ptr
|
DbConfig |
getDbConfig()
get the db config
|
DataBlock |
memorySearch(long ip)
get the region with a int ip address with memory binary search algorithm
|
DataBlock |
memorySearch(String ip)
get the region throught the ip address with memory binary search algorithm
|
public static final int BTREE_ALGORITHM
public static final int BINARY_ALGORITHM
public static final int MEMORY_ALGORITYM
public DbSearcher(DbConfig dbConfig, String dbFile) throws FileNotFoundException
bdConfig - dbFile - FileNotFoundExceptionpublic DataBlock memorySearch(long ip) throws IOException
ip - IOExceptionpublic DataBlock memorySearch(String ip) throws IOException
ip - IOExceptionpublic DataBlock getByIndexPtr(long ptr) throws IOException
indexPtr - IOExceptionpublic DataBlock btreeSearch(long ip) throws IOException
ip - IOExceptionpublic DataBlock btreeSearch(String ip) throws IOException
ip - IOExceptionpublic DataBlock binarySearch(long ip) throws IOException
ip - IOExceptionpublic DataBlock binarySearch(String ip) throws IOException
ip - IOExceptionpublic DbConfig getDbConfig()
public void close()
throws IOException
IOExceptionCopyright © 2018. All rights reserved.