|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.jalios.jstore.jsync.JSyncLogger
public class JSyncLogger
This class writes logs JSyncReplica actions such as join, disjoin, update, etc.
| Field Summary | |
|---|---|
static String |
REVISION
|
| Fields inherited from interface com.jalios.jstore.jsync.JSyncConstants |
|---|
SC_BAD_ADDRESS, SC_BAD_LEADER, SC_BAD_MESSAGE, SC_INTERNAL_SERVER_ERROR, SC_JOIN_REJECTED, SC_LEADER_CANNOT_JOIN, SC_NO_ACK, SC_NO_SEND, SC_OK, SC_UNKNOWN, SC_UNKNOWN_URID, SC_URID_ALREADY_ADDED, STATUS_LEADER, STATUS_LONE, STATUS_MEMBER, STATUS_SUBLEADER |
| Fields inherited from interface com.jalios.util.JaliosConstants |
|---|
CRLF, MILLIS_IN_ONE_DAY, MILLIS_IN_ONE_HOUR, MILLIS_IN_ONE_MINUTE, MILLIS_IN_ONE_MONTH, MILLIS_IN_ONE_SECOND, MILLIS_IN_ONE_WEEK, MILLIS_IN_ONE_YEAR |
| Constructor Summary | |
|---|---|
JSyncLogger(File logDir)
Constructs a new JSyncLogger |
|
| Method Summary | |
|---|---|
void |
add(String type,
String action,
String urid,
int sc,
long duration,
TreeMap<String,String> extra)
Generic method to add a new entry in the log |
void |
addDisjoinIn(String urid,
int sc,
long duration)
Logs an incoming disjoin |
void |
addDisjoinOut(String urid,
int sc,
long duration)
Logs an outgoing disjoin |
void |
addJoinIn(String urid,
int sc,
long duration)
Logs an incoming join |
void |
addJoinOut(String urid,
int sc,
long duration)
Logs an outgoind join |
void |
addRejectedMessage(String urid,
int sc)
Logs an internal message rejecting |
void |
addRemoveReplica(String urid)
Logs an internal replica removing |
void |
addSuggestJoinIn(String urid,
int sc,
long duration)
Logs an incoming suggestjoin |
void |
addSuggestJoinOut(String urid,
int sc,
long duration)
Logs an outging suggestjoin |
void |
addUpdateIn(String urid,
int sc,
long duration,
int nbOps,
int nbFiles,
boolean merge,
int nbUU,
int nbUD,
int nbDU,
int nbDD)
Logs an incoming update |
void |
addUpdateOut(String urid,
int sc,
long duration,
int nbOps,
int nbFiles,
boolean partial)
Logs an outgoing update |
File |
getLogFile(Date date)
Return the log file for the given date |
List<File> |
getLogFileList(Date beginDate,
Date endDate)
Return a list of log file for the given date range |
String |
getStatusLabel(int sc,
Locale locale)
Return the label of the given status code |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String REVISION
| Constructor Detail |
|---|
public JSyncLogger(File logDir)
logDir - the log directory| Method Detail |
|---|
public File getLogFile(Date date)
date - the date
public List<File> getLogFileList(Date beginDate,
Date endDate)
beginDate - the begin dateendDate - the end date
public String getStatusLabel(int sc,
Locale locale)
sc - the status code (must be a new status code value (e.g. 1101, 1200, ...)locale - the locale to be used
public void add(String type,
String action,
String urid,
int sc,
long duration,
TreeMap<String,String> extra)
type - the type of the log (in, out, internal)action - the action (join, disjoin, update, ...)urid - the uridsc - the status codeduration - the durationextra - an extra map of attributes
public void addJoinIn(String urid,
int sc,
long duration)
urid - the urid of the replica which has sent the join messagesc - the status code sentduration - the duration
public void addSuggestJoinIn(String urid,
int sc,
long duration)
urid - the urid of the replica which has sent the join messagesc - the status code sentduration - the duration
public void addSuggestJoinOut(String urid,
int sc,
long duration)
urid - the urid of the replica which has sent the join messagesc - the status code sentduration - the duration
public void addJoinOut(String urid,
int sc,
long duration)
urid - the urid of the leadersc - the status code receivedduration - the duration
public void addDisjoinIn(String urid,
int sc,
long duration)
urid - the urid of the replica which has sent the disjoin messagesc - the status code sentduration - the duration
public void addDisjoinOut(String urid,
int sc,
long duration)
urid - the urid of the leadersc - the status code receivedduration - the duration
public void addUpdateIn(String urid,
int sc,
long duration,
int nbOps,
int nbFiles,
boolean merge,
int nbUU,
int nbUD,
int nbDU,
int nbDD)
urid - the urid of the replica which has sent the update messagesc - the status code sentduration - the durationnbOps - the number of operationsnbFiles - the number of filesmerge - true if the 2 divergents store suffix have been mergednbUU - the number of U/U conflictsnbUD - the number of U/D conflictsnbDU - the number of D/U conflictsnbDD - the number of D/D conflicts
public void addUpdateOut(String urid,
int sc,
long duration,
int nbOps,
int nbFiles,
boolean partial)
urid - the urid of the replica the message has been sentsc - the status code receivedduration - the durationnbOps - the number of operationsnbFiles - the number of filespartial - true if this is a partial updatepublic void addRemoveReplica(String urid)
urid - the urid of the replica removed
public void addRejectedMessage(String urid,
int sc)
urid - the urid of the replica rejectedsc - the status code sent
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||