ignite-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pavel Tupitsyn <ptupit...@apache.org>
Subject Re: Ignite inside OData WebAPI
Date Fri, 23 Sep 2016 08:28:10 GMT
Hi,

1) The code looks good to me. What exactly is the issue? Is there an
exception, or do you get incorrect results?
2) There is a known issue with IIS: it performs a shadow-copy [1] of
application assemblies (dll files), which makes it impossible for Ignite to
detect Libs directory with jar files.
If your libs directory is in bin folder (as it is when NuGet is used), the
solution is the following [2]:

IgniteConfiguration.JvmClasspath =
Directory.GetFiles(Server.MapPath(@"~\bin\libs")).Aggregate((x, y) => x +
";" + y);

Let me know if this helps.


[1] https://msdn.microsoft.com/en-us/library/ms404279(v=vs.110).aspx
[2]
https://apacheignite-net.readme.io/docs/aspnet-output-caching#configuration-starting-ignite-manually

On Fri, Sep 23, 2016 at 6:02 AM, Murthy Kakarlamudi <ksatya@gmail.com>
wrote:

> Hi,
>    I am trying to expose Cache contents as an Odata API. I created the
> Odata API using ASP.NET WebAPI. Inside the API implementation, I am
> initializing Ignite in cache mode. Below is the method I am using to
> retrieve a listing. I have 2 questions.
>
> 1. I was not able to use Select option in AsCacheQueryable. How to get a
> list of all the entries in the cache from LINQ?
> 2. Embedded IIS server quits the process after it hits var ignite =
> Ignition.Start(cfg); statement. Processing stops beyond this statement. I
> confirmed this in debug mode. It does not throw any errors in the console.
> Not sure if it is possible to start Ignite in client mode in Web API that
> is deployed on IIS.
>
> Any help will be much appreciated. Thanks.
>
> public List<Movie> GetMovies()
>         {
>             var cfg = new IgniteConfiguration
>             {
>                 BinaryConfiguration = new Apache.Ignite.Core.Binary.
> BinaryConfiguration(typeof(Movie), typeof(StarRating), typeof(Person)),
>                 JvmOptions = new List<string> { "-Xms512m", "-Xmx1024m" }
>             };
>             Ignition.ClientMode = true;
>             var ignite = Ignition.Start(cfg);
>             var cache = ignite.GetOrCreateCache<int, Movie>(new
> CacheConfiguration
>             {
>                 Name = "myMusicCache",
>                 QueryEntities = new[]
>             {
>                         new QueryEntity(typeof(int), typeof(Movie))
>
>                     }
>             });
>             List<Movie> movies = new List<Movie>();
>             IQueryable<ICacheEntry<int, Movie>> qry =
>                 cache.AsCacheQueryable().Where(m => m.Key == 1);
>
>             foreach (ICacheEntry<int, Movie> entry in qry)
>             {
>                 Console.WriteLine("Movie: " + entry.Value);
>                 movies.Add(entry.Value);
>             }
>
>
>             return movies;
>         }
>

Mime
View raw message