Hi
I want to pull all the documents from a rdb to start an ETL process off.
What is the best way of doing this?
So far i have the following but it craps out at 128 records?
public class ReadRavenDupeOperation : AbstractOperation
{
private readonly IDocumentStore store;
private IDocumentSession session;
public ReadRavenDupeOperation(IDocumentStore store)
{
this.store = store;
session = store.OpenSession();
session.Advanced.MaxNumberOfRequestsPerSession = 1000;
}
public override IEnumerable<Row> Execute(IEnumerable<Row> rows)
{
var stats = new RavenQueryStatistics();
var count = session.Query<DupeTable>().Statistics(out
stats).ToList();
var loops = stats.TotalResults / 100;
for (int i = 0; i < loops; i++)
{
if (session == null)
{
session = store.OpenSession();
session.Advanced.MaxNumberOfRequestsPerSession = 1000;
}
var docs =
session.Query<DupeTable>().ToList().Skip(i*100).Take(100);
if (Statistics.OutputtedRows > 0 &&
Statistics.OutputtedRows%1000 == 0)
{
session.Dispose();
session = null;
}
foreach (var doc in docs)
{
yield return Row.FromObject(doc);
}
}
}
}
--
Cheers,
w://
--
You received this message because you are subscribed to the Google Groups
"Rhino Tools Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/rhino-tools-dev?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.