/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at
* trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
* add the following below this CDDL HEADER, with the fields enclosed
* by brackets "[]" replaced with your own identifying information:
* Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*
*
* Copyright 2010 Sun Microsystems, Inc.
*/
class EclReadAndPlay {
// dbPath --> stores files containing csn of identifiers
// configPath --> stores masters config file
// Maximum time (in milliseconds) without update being read from the master: 60 s
// ECL "draft" mode -- Initial changeNumber
// ECL "opends" mode -- Initial control value:
// --control "1.3.6.1.4.1.26027.1.5.4:false:;" ==> first cookie: ";"
static boolean displayMissingChanges = false;
{
// Load latest read CSN values from files in db/ directory
try {
}
};
// System.out.println(files[i] + "\t" + mycsn);
}
}
} catch (IOException e) {
e.printStackTrace();
}
/********** Parse arguments **********/
int masterN=0;
// ECL mode: "opends" or "draft"
}
// Queue size
}
// Display missing changes?
displayMissingChanges = true;
else
displayMissingChanges = false;
}
// Bind DN
}
// Bind password
}
// Stand-alone server:port
}
// Replicated masters
}
// Standard output file
}
k++;
} /* for() */
outputFilename == null ) {
+ "-x {(displayMissingChanges):true|false} "
+ "-o {outputFilename} -D {bindD} -w {bindPwd} "
+ "-s {standalone-host:port} "
+ "-p {master1-host:port} "
+ "-p {master2-host:port}...");
}
/* try {
File mastersFile= new File(configPath, mastersFilename);
LineNumberReader in=new LineNumberReader (new FileReader(mastersFile) );
String line;
while ( in.ready() ) {
line=in.readLine();
masters.add(new Server(line));
}
} catch (IOException e) {
println ("ERROR", e.toString());
System.exit(1);
} */
// System.out.println(masters);
/*************************************/
// Output file (logs are appended)
try {
} catch (IOException e) {
e.printStackTrace();
}
// Access log (data is appended)
try {
accessOut = new PrintWriter(new BufferedWriter(new FileWriter( new File(logsPath, accessFilename)) ) );
} catch (IOException e) {
e.printStackTrace();
}
// Create a bounded blocking queue of integers
// Initialise reader thread --> read updates from replicated master
// Initialise writer thread --> write updates onto stand-alone server
synchronized (lock) {
try {
} catch (Exception e) {
e.printStackTrace();
}
}
int i=0;
while (true) {
total_nb_ops += nb_ops;
+ " ops/s, Total = " + total_nb_ops
nb_ops = 0;
if ( i++ == 3 && displayMissingChanges == true ) {
+ ", lastChangeNumber = " + lastChangeNumber
if (lastMissingChanges == 0)
lastMissingChanges = 1;
+ ", lastExternalChangelogCookie = "
}
i = 0;
}
}
}
public static void inc_ops(int c) {
nb_ops++;
changeNumber = c;
}
nb_ops++;
changelogCookie = c;
}
public static void inc_ignored(int c) {
nb_ignored++;
changeNumber = c;
}
nb_ignored++;
changelogCookie = c;
}
// Initialize the today's date string
}
}
try {
}
catch ( InterruptedException e )
{
}
}
}