}
public static void main(String args[]) {
HounderDocumentGenerator dg = new HounderDocumentGenerator(args[0]);
try {
RmiIndexerStub indexerStub = new RmiIndexerStub(9003, "localhost");
for (int i=0; i < Integer.parseInt(args[1]); i++) {
//String argstr[] = {"\'" + dg.getDocument() + "\'"};
//System.out.println(dg.getDocument() + "\n\n");
String doc = dg.getDocument();
IndexerReturnCode result = indexerStub.index(doc);
while (result == IndexerReturnCode.RETRY_QUEUE_FULL) {
System.out.println("queue full " + new Date());
try {
Thread.sleep(1000);
}
catch (Exception e) {
//ignore
}
result = indexerStub.index(doc);
}
if (i % 1000 == 0) {
System.out.println (i + " documents posted");
System.out.println(new Date());
//System.out.println(doc);