openlsd.server.admin.commoncheck.LSDCheckCommon Class Reference
List of all members.
Detailed Description
Common functions to Check consistency between DB and LSD
- Author:
- Frederic Bregier LGPL
|
Public Member Functions |
| LSDCheckCommon (int checkFromLSD, LSDDbAdmin admin, String sqlreq) |
void | run () |
Static Public Member Functions |
static void | runC (LSDDbAdmin admin, Timestamp opdate, LSDLegacy lsdlegacy, File dirsource) |
static void | runJava (LSDDbAdmin admin, Timestamp opdate, LSDLegacy lsdlegacy, File dirsource) |
static void | checkBothSides (LSDDbAdmin admin, LSDLegacy lsdlegacy, Timestamp opdate, boolean repairdb, boolean repairlsd, boolean repairupdb) |
Static Public Attributes |
static final byte | sep = ' ' |
static final byte | end = '\n' |
static final byte | nodata = '@' |
static int | limit = 85 |
static final int | sizeline = 100 |
static boolean | checkmd5 = true |
static boolean | outputResult = true |
static final int | CHECKLSD = 0 |
static final int | CHECKDB = 1 |
static final int | CHECKUPDB = 2 |
Protected Member Functions |
void | checkFromLSD () |
void | checkFromDB () |
void | checkFromUpDB () |
Static Protected Member Functions |
static File | createtempFile (File dir) |
static FileChannel | createFileChannel (File file) |
static boolean | addFileToByteBuffer (File file, byte[]blid, ByteBuffer niobb) |
static void | writeTempFile (ByteBuffer niobb, FileChannel filechannelout) |
static void | loadTempFile (LSDDbAdmin admin, File outputfile, long nbfile) |
static String | getUpDB (long newlid) |
Protected Attributes |
int | checkFromLSD = -1 |
LSDDbAdmin | adminThread = null |
String | sqlreq = null |
Static Protected Attributes |
static LSDLegacy | lsdlegacy = null |
static boolean | repairdb = false |
static boolean | repairlsd = false |
static boolean | repairupdb = false |
static Timestamp | opdate = null |
Static Private Member Functions |
static long | runJavaRecur (File dirsource, String outpath, ByteBuffer niobb, long nbfile, byte[]blid, FileChannel filechannelout, long ldate) |
Constructor & Destructor Documentation
openlsd.server.admin.commoncheck.LSDCheckCommon.LSDCheckCommon |
( |
int |
checkFromLSD, |
|
|
LSDDbAdmin |
admin, |
|
|
String |
sqlreq | |
|
) |
| | |
Create a thread for LSDCheckCommon
- Parameters:
-
| checkFromLSD | Set to CHECKLSD to check From LSD, CHECKDB from DB, CHECKUPDB from DB with MD5 update |
| admin | |
| sqlreq | |
Member Function Documentation
static File openlsd.server.admin.commoncheck.LSDCheckCommon.createtempFile |
( |
File |
dir |
) |
[static, protected] |
Create a temp file in dir
- Parameters:
-
- Returns:
- the temp File created or Null if in error
static FileChannel openlsd.server.admin.commoncheck.LSDCheckCommon.createFileChannel |
( |
File |
file |
) |
[static, protected] |
Create a filechannel out from file
- Parameters:
-
- Returns:
- the filechannel out from file or Null if in error
static void openlsd.server.admin.commoncheck.LSDCheckCommon.runC |
( |
LSDDbAdmin |
admin, |
|
|
Timestamp |
opdate, |
|
|
LSDLegacy |
lsdlegacy, |
|
|
File |
dirsource | |
|
) |
| | [static] |
run getLSDFiles in subdirectories in C
- Parameters:
-
| admin | The Admin DB Object |
| opdate | The Date as beginning of test (or null if all) |
| lsdlegacy | The Legacy from LSD to check |
| dirsource | The Path to check |
static void openlsd.server.admin.commoncheck.LSDCheckCommon.runJava |
( |
LSDDbAdmin |
admin, |
|
|
Timestamp |
opdate, |
|
|
LSDLegacy |
lsdlegacy, |
|
|
File |
dirsource | |
|
) |
| | [static] |
run getLSDFiles in subdirectories in Java
- Parameters:
-
| admin | The Admin DB Object |
| opdate | The Date as beginning of test (or null if all) |
| lsdlegacy | The Legacy from LSD to check |
| dirsource | The Path to check |
static long openlsd.server.admin.commoncheck.LSDCheckCommon.runJavaRecur |
( |
File |
dirsource, |
|
|
String |
outpath, |
|
|
ByteBuffer |
niobb, |
|
|
long |
nbfile, |
|
|
byte[] |
blid, |
|
|
FileChannel |
filechannelout, |
|
|
long |
ldate | |
|
) |
| | [static, private] |
run getLSDFiles in subdirectories in Java
- Parameters:
-
| dirsource | The Path to check |
| outpath | the path where to create temp file |
| niobb | |
| nbfile | |
| blid | |
| filechannelout | |
| ldate | |
- Returns:
- number of current reference into ByteBuffer
static boolean openlsd.server.admin.commoncheck.LSDCheckCommon.addFileToByteBuffer |
( |
File |
file, |
|
|
byte[] |
blid, |
|
|
ByteBuffer |
niobb | |
|
) |
| | [static, protected] |
Add one file into the ByteBuffer
- Parameters:
-
- Returns:
- True if inserted, else False
static void openlsd.server.admin.commoncheck.LSDCheckCommon.writeTempFile |
( |
ByteBuffer |
niobb, |
|
|
FileChannel |
filechannelout | |
|
) |
| | [static, protected] |
Write the temp file
- Parameters:
-
static void openlsd.server.admin.commoncheck.LSDCheckCommon.loadTempFile |
( |
LSDDbAdmin |
admin, |
|
|
File |
outputfile, |
|
|
long |
nbfile | |
|
) |
| | [static, protected] |
Load the temp file into DB Check
- Parameters:
-
void openlsd.server.admin.commoncheck.LSDCheckCommon.run |
( |
|
) |
|
void openlsd.server.admin.commoncheck.LSDCheckCommon.checkFromDB |
( |
|
) |
[protected] |
void openlsd.server.admin.commoncheck.LSDCheckCommon.checkFromUpDB |
( |
|
) |
[protected] |
static String openlsd.server.admin.commoncheck.LSDCheckCommon.getUpDB |
( |
long |
newlid |
) |
[static, protected] |
Get the UpDB Select request
- Parameters:
-
- Returns:
- the String with the SQL request
static void openlsd.server.admin.commoncheck.LSDCheckCommon.checkBothSides |
( |
LSDDbAdmin |
admin, |
|
|
LSDLegacy |
lsdlegacy, |
|
|
Timestamp |
opdate, |
|
|
boolean |
repairdb, |
|
|
boolean |
repairlsd, |
|
|
boolean |
repairupdb | |
|
) |
| | [static] |
Check into DB in both direction LSDDocument <-> LSDCheck
- Parameters:
-
| admin | |
| lsdlegacy | |
| opdate | |
| repairdb | |
| repairlsd | |
| repairupdb | |
Member Data Documentation
Number of reference to put in ByteBuffer. Each reference is about 97 bytes (round to 100) and this number should be close to a multiple of 4K (here 8K => 85) like newlimit0*96 = x*4K GETFILEFROMPATH(JavaRecurNIO):31582
Max Size of one line (Really = 96, but take 100 as closest value)
Should we print output result
Boolean to fix if DB is to be repaired
Boolean to fix if LSD is to be repaired
Boolean to fix if DB is to be repaired with updating MD5
The timestamp that fixes the beginning of the check
The DB Admin Object for the thread
The SQLRequest to execute
Check from DB with MD5 update
The documentation for this class was generated from the following file:
- OpenLSD/ServerApp/openlsd/server/admin/commoncheck/LSDCheckCommon.java