public static bool IngestMultiEnvTable(ChinaOpalSearch.EntityID entityId, ChinaOpalSearch.SnappsEntity entity) { bool result = false; List <ITableLocation> locations = new List <ITableLocation> { new Microsoft.ObjectStore.Environment(Config.environment) }; DataLoadConfiguration config = new DataLoadConfiguration(locations, "msnjvfeeds", "SnappsEntity", 20, 20, 2, 10000); DataLoader loader = new DataLoader(config); List <IDataLoadResult> results; object context = new object(); while (true) { // Important: key and value objects are cached until flushed. Changing the contents of key or value before the flush will alter the previously added data loader.Send(entityId, entity, context); results = loader.Receive(false); //LogResults(results); } loader.Flush(); results = loader.Receive(true); //LogResults(results); return(result); }
private OSContext() { //foreach (var env in ConfigStore.Instance.OsClientConfig.OSEnv) //{ // this.Locations.Add(new Microsoft.ObjectStore.VIP(env)); //} Locations.Add(new Microsoft.ObjectStore.VIP("objectstoremulti.int.co.playmsn.com:83")); //this.Configuration = new DataLoadConfiguration( // this.Locations, // ConfigStore.Instance.OsClientConfig.OSNamespace, // ConfigStore.Instance.OsClientConfig.OSTable, // ConfigStore.Instance.OsClientConfig.MaxObjectsPerRequest, // ConfigStore.Instance.OsClientConfig.MaxSimultaneousRequests, // ConfigStore.Instance.OsClientConfig.RetriesPerRequest, // ConfigStore.Instance.OsClientConfig.HttpTimeOutInMs, // ConfigStore.Instance.OsClientConfig.MaxKeysPerSecond, // true // ); Configuration = new DataLoadConfiguration( Locations, "RaaObjectStore", "RaaImageTest", 5, 5, 3, 10000, 6, true); }
public static void Delete(string keyString, object context, DataLoadConfiguration config) { using (DataLoader loader = new DataLoader(config)) { Delete(keyString, context, loader); loader.Flush(); loader.Receive(true); } }
public static void Ingest(string keyString, byte[] data, object context, DataLoadConfiguration config) { using (DataLoader loader = new DataLoader(config)) { Ingest(keyString, data, context, loader); loader.Flush(); loader.Receive(true); } }