You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by Som Som <2a...@gmail.com> on 2018/09/12 10:26:48 UTC
cache doesn't exist
Hello
I created new cache using thin .net client:
public class TestEntity
{
public string ValueString { get; set; }
public DateTime ValueDateTime { get; set; }
}
class Program
{
static void Main(string[] args)
{
var ignite = Ignition.StartClient(newIgniteClientConfiguration
{
Host = "127.0.0.1"
,
BinaryConfiguration = newApache.Ignite.Core.Binary.
BinaryConfiguration { Serializer = new Apache.Ignite.Core.Binary.
BinaryReflectiveSerializer { ForceTimestamp = true } }
});
var queryEntity = new QueryEntity();
queryEntity.KeyTypeName =typeof(int).FullName;
queryEntity.KeyType = typeof(int);
queryEntity.ValueTypeName =typeof(TestEntity).FullName;
queryEntity.ValueType = typeof(TestEntity);
queryEntity.Fields = new QueryField[]
{ new QueryField("ValueString", typeof(string))
, new QueryField("ValueDateTime",typeof(DateTime))
};
var cache = ignite.GetOrCreateCache<int,TestEntity>(
newCacheClientConfiguration(
"TestEntity", queryEntity) { SqlSchema = "PUBLIC" });
cache.Put(1, new TestEntity { ValueString ="test",
ValueDateTime = DateTime.UtcNow });
ignite.Dispose();
}
}
Then i tried to get this cache using typical .net client but instead of
cache I got an error “Additional information: Cache doesn't exist:
TestEntity”:
class Program
{
static void Main(string[] args)
{
var ignite = Ignition.Start(newIgniteConfiguration
{
DiscoverySpi = new TcpDiscoverySpi
{
IpFinder = new TcpDiscoveryStaticIpFinder
{
Endpoints = new[] { "127.0.0.1" }
}
}
});
var cache = ignite.GetCache<int, TestEntity>("TestEntity");
ignite.Dispose();
}
}
How can I get a cache correctly?
Re: cache doesn't exist
Posted by Igor Sapego <is...@apache.org>.
Hi,
Did your thick .net client connected to the cluster?
It should be visible in server node's logs.
Best Regards,
Igor
On Wed, Sep 12, 2018 at 1:58 PM Som Som <2a...@gmail.com> wrote:
> the cache names list is empty then i call the method of non thin client
> butmy TestCache is stil exists and i can see it under the thin client. i
> cant see the cache from NON thin client if it is created from thin client.
>
> ср, 12 сент. 2018 г., 13:29 Evgenii Zhuravlev <e....@gmail.com>:
>
>> Hi,
>>
>> You can always get the list of the all caches in cluster using
>> Ignite.cacheNames() method.
>>
>> Evgenii
>>
>> ср, 12 сент. 2018 г. в 13:26, Som Som <2a...@gmail.com>:
>>
>>> Hello
>>>
>>>
>>>
>>> I created new cache using thin .net client:
>>>
>>>
>>>
>>> public class TestEntity
>>>
>>> {
>>>
>>> public string ValueString { get; set; }
>>>
>>>
>>>
>>> public DateTime ValueDateTime { get; set; }
>>>
>>> }
>>>
>>>
>>>
>>> class Program
>>>
>>> {
>>>
>>> static void Main(string[] args)
>>>
>>> {
>>>
>>> var ignite = Ignition.StartClient(new
>>> IgniteClientConfiguration
>>>
>>> {
>>>
>>> Host = "127.0.0.1"
>>>
>>> ,
>>>
>>> BinaryConfiguration = newApache.Ignite.Core.Binary.
>>> BinaryConfiguration { Serializer = new Apache.Ignite.Core.Binary.
>>> BinaryReflectiveSerializer { ForceTimestamp = true } }
>>>
>>> });
>>>
>>>
>>>
>>> var queryEntity = new QueryEntity();
>>>
>>> queryEntity.KeyTypeName =typeof(int).FullName;
>>>
>>> queryEntity.KeyType = typeof(int);
>>>
>>>
>>>
>>> queryEntity.ValueTypeName =typeof(TestEntity).FullName;
>>>
>>> queryEntity.ValueType = typeof(TestEntity);
>>>
>>>
>>>
>>> queryEntity.Fields = new QueryField[]
>>>
>>> { new QueryField("ValueString", typeof(string))
>>>
>>> , new QueryField("ValueDateTime",typeof(DateTime))
>>>
>>> };
>>>
>>>
>>>
>>> var cache = ignite.GetOrCreateCache<int,TestEntity>(
>>>
>>> newCacheClientConfiguration(
>>> "TestEntity", queryEntity) { SqlSchema = "PUBLIC" });
>>>
>>>
>>>
>>>
>>>
>>> cache.Put(1, new TestEntity { ValueString ="test",
>>> ValueDateTime = DateTime.UtcNow });
>>>
>>>
>>>
>>> ignite.Dispose();
>>>
>>> }
>>>
>>> }
>>>
>>>
>>>
>>> Then i tried to get this cache using typical .net client but instead of
>>> cache I got an error “Additional information: Cache doesn't exist:
>>> TestEntity”:
>>>
>>>
>>>
>>> class Program
>>>
>>> {
>>>
>>> static void Main(string[] args)
>>>
>>> {
>>>
>>> var ignite = Ignition.Start(newIgniteConfiguration
>>>
>>> {
>>>
>>> DiscoverySpi = new TcpDiscoverySpi
>>>
>>> {
>>>
>>> IpFinder = new TcpDiscoveryStaticIpFinder
>>>
>>> {
>>>
>>> Endpoints = new[] { "127.0.0.1" }
>>>
>>> }
>>>
>>> }
>>>
>>> });
>>>
>>>
>>>
>>>
>>>
>>> var cache = ignite.GetCache<int, TestEntity>("TestEntity");
>>>
>>>
>>>
>>> ignite.Dispose();
>>>
>>> }
>>>
>>> }
>>>
>>>
>>>
>>> How can I get a cache correctly?
>>>
>>
Re: cache doesn't exist
Posted by Som Som <2a...@gmail.com>.
the cache names list is empty then i call the method of non thin client
butmy TestCache is stil exists and i can see it under the thin client. i
cant see the cache from NON thin client if it is created from thin client.
ср, 12 сент. 2018 г., 13:29 Evgenii Zhuravlev <e....@gmail.com>:
> Hi,
>
> You can always get the list of the all caches in cluster using
> Ignite.cacheNames() method.
>
> Evgenii
>
> ср, 12 сент. 2018 г. в 13:26, Som Som <2a...@gmail.com>:
>
>> Hello
>>
>>
>>
>> I created new cache using thin .net client:
>>
>>
>>
>> public class TestEntity
>>
>> {
>>
>> public string ValueString { get; set; }
>>
>>
>>
>> public DateTime ValueDateTime { get; set; }
>>
>> }
>>
>>
>>
>> class Program
>>
>> {
>>
>> static void Main(string[] args)
>>
>> {
>>
>> var ignite = Ignition.StartClient(new
>> IgniteClientConfiguration
>>
>> {
>>
>> Host = "127.0.0.1"
>>
>> ,
>>
>> BinaryConfiguration = newApache.Ignite.Core.Binary.
>> BinaryConfiguration { Serializer = new Apache.Ignite.Core.Binary.
>> BinaryReflectiveSerializer { ForceTimestamp = true } }
>>
>> });
>>
>>
>>
>> var queryEntity = new QueryEntity();
>>
>> queryEntity.KeyTypeName =typeof(int).FullName;
>>
>> queryEntity.KeyType = typeof(int);
>>
>>
>>
>> queryEntity.ValueTypeName =typeof(TestEntity).FullName;
>>
>> queryEntity.ValueType = typeof(TestEntity);
>>
>>
>>
>> queryEntity.Fields = new QueryField[]
>>
>> { new QueryField("ValueString", typeof(string))
>>
>> , new QueryField("ValueDateTime",typeof(DateTime))
>>
>> };
>>
>>
>>
>> var cache = ignite.GetOrCreateCache<int,TestEntity>(
>>
>> newCacheClientConfiguration(
>> "TestEntity", queryEntity) { SqlSchema = "PUBLIC" });
>>
>>
>>
>>
>>
>> cache.Put(1, new TestEntity { ValueString ="test",
>> ValueDateTime = DateTime.UtcNow });
>>
>>
>>
>> ignite.Dispose();
>>
>> }
>>
>> }
>>
>>
>>
>> Then i tried to get this cache using typical .net client but instead of
>> cache I got an error “Additional information: Cache doesn't exist:
>> TestEntity”:
>>
>>
>>
>> class Program
>>
>> {
>>
>> static void Main(string[] args)
>>
>> {
>>
>> var ignite = Ignition.Start(newIgniteConfiguration
>>
>> {
>>
>> DiscoverySpi = new TcpDiscoverySpi
>>
>> {
>>
>> IpFinder = new TcpDiscoveryStaticIpFinder
>>
>> {
>>
>> Endpoints = new[] { "127.0.0.1" }
>>
>> }
>>
>> }
>>
>> });
>>
>>
>>
>>
>>
>> var cache = ignite.GetCache<int, TestEntity>("TestEntity");
>>
>>
>>
>> ignite.Dispose();
>>
>> }
>>
>> }
>>
>>
>>
>> How can I get a cache correctly?
>>
>
Re: cache doesn't exist
Posted by Evgenii Zhuravlev <e....@gmail.com>.
Hi,
You can always get the list of the all caches in cluster using
Ignite.cacheNames() method.
Evgenii
ср, 12 сент. 2018 г. в 13:26, Som Som <2a...@gmail.com>:
> Hello
>
>
>
> I created new cache using thin .net client:
>
>
>
> public class TestEntity
>
> {
>
> public string ValueString { get; set; }
>
>
>
> public DateTime ValueDateTime { get; set; }
>
> }
>
>
>
> class Program
>
> {
>
> static void Main(string[] args)
>
> {
>
> var ignite = Ignition.StartClient(newIgniteClientConfiguration
>
> {
>
> Host = "127.0.0.1"
>
> ,
>
> BinaryConfiguration = newApache.Ignite.Core.Binary.
> BinaryConfiguration { Serializer = new Apache.Ignite.Core.Binary.
> BinaryReflectiveSerializer { ForceTimestamp = true } }
>
> });
>
>
>
> var queryEntity = new QueryEntity();
>
> queryEntity.KeyTypeName =typeof(int).FullName;
>
> queryEntity.KeyType = typeof(int);
>
>
>
> queryEntity.ValueTypeName =typeof(TestEntity).FullName;
>
> queryEntity.ValueType = typeof(TestEntity);
>
>
>
> queryEntity.Fields = new QueryField[]
>
> { new QueryField("ValueString", typeof(string))
>
> , new QueryField("ValueDateTime",typeof(DateTime))
>
> };
>
>
>
> var cache = ignite.GetOrCreateCache<int,TestEntity>(
>
> newCacheClientConfiguration(
> "TestEntity", queryEntity) { SqlSchema = "PUBLIC" });
>
>
>
>
>
> cache.Put(1, new TestEntity { ValueString ="test",
> ValueDateTime = DateTime.UtcNow });
>
>
>
> ignite.Dispose();
>
> }
>
> }
>
>
>
> Then i tried to get this cache using typical .net client but instead of
> cache I got an error “Additional information: Cache doesn't exist:
> TestEntity”:
>
>
>
> class Program
>
> {
>
> static void Main(string[] args)
>
> {
>
> var ignite = Ignition.Start(newIgniteConfiguration
>
> {
>
> DiscoverySpi = new TcpDiscoverySpi
>
> {
>
> IpFinder = new TcpDiscoveryStaticIpFinder
>
> {
>
> Endpoints = new[] { "127.0.0.1" }
>
> }
>
> }
>
> });
>
>
>
>
>
> var cache = ignite.GetCache<int, TestEntity>("TestEntity");
>
>
>
> ignite.Dispose();
>
> }
>
> }
>
>
>
> How can I get a cache correctly?
>