Skip to content

Instantly share code, notes, and snippets.

View ptupitsyn's full-sized avatar

Pavel Tupitsyn ptupitsyn

View GitHub Profile
@ptupitsyn
ptupitsyn / Program.cs
Last active October 3, 2022 18:27
Apache Ignite.NET SQL indexes: compound, individual, parts of key and value
using Apache.Ignite.Core;
using Apache.Ignite.Core.Cache.Configuration;
using Apache.Ignite.Core.Cache.Query;
using var ignite = Ignition.Start();
var cacheCfg = new CacheConfiguration("people")
{
QueryEntities = new[]
{
@ptupitsyn
ptupitsyn / EntryProcessorComputeTask.java
Created September 14, 2022 12:24
Ignite.NET mixed cluster Cache.Invoke
import org.apache.ignite.Ignite;
import org.apache.ignite.IgniteException;
import org.apache.ignite.cluster.ClusterNode;
import org.apache.ignite.compute.ComputeJob;
import org.apache.ignite.compute.ComputeJobAdapter;
import org.apache.ignite.compute.ComputeJobResult;
import org.apache.ignite.compute.ComputeTaskAdapter;
import org.apache.ignite.resources.IgniteInstanceResource;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@ptupitsyn
ptupitsyn / Program.cs
Last active July 17, 2022 19:17
Linux Dir Sync - copy files to external HDD on Linux with sync command after every file
using System.Diagnostics;
using System.Runtime.InteropServices;
var cts = new CancellationTokenSource();
var cancelEvt = new ManualResetEventSlim();
Console.CancelKeyPress += delegate {
cts.Cancel();
cancelEvt.Wait();
};
@ptupitsyn
ptupitsyn / IgniteStreamerWithExpiry.csproj
Created May 31, 2022 10:55
Ignite.NET DataStreamer with ExpiryPolicy
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
@ptupitsyn
ptupitsyn / IgniteThinAtomicLong.csproj
Created March 11, 2022 16:02
Ignite.NET Thin Client AtomicLong usage via Services
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
@ptupitsyn
ptupitsyn / IgniteClientPool.cs
Last active February 11, 2022 13:12
Apache Ignite.NET Thin Client Pool
using Apache.Ignite.Core;
using Apache.Ignite.Core.Client;
using Microsoft.Extensions.ObjectPool;
namespace IgniteThinClientConnectionPool;
public class IgniteClientPool
{
private const int ReconnectRetryLimit = 3;
@ptupitsyn
ptupitsyn / IgniteOracleLoader.csproj
Created January 26, 2022 08:03
Load data into Ignite from Oracle
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
@ptupitsyn
ptupitsyn / StreamVsLoopBenchmark.java
Last active September 9, 2021 08:18
Java streams vs loops benchmark
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
@ptupitsyn
ptupitsyn / Program.cs
Created December 6, 2020 13:58
Apache Ignite PeerAssemblyLoading demo - Client
using System;
using Apache.Ignite.Core;
using Apache.Ignite.Core.Compute;
using Apache.Ignite.Core.Deployment;
namespace client
{
class HelloAction : IComputeAction
{
public void Invoke()
@ptupitsyn
ptupitsyn / Program.cs
Created December 6, 2020 13:58
Apache Ignite PeerAssemblyLoading demo - Server
using System;
using System.Threading;
using Apache.Ignite.Core;
using Apache.Ignite.Core.Deployment;
namespace server
{
class Program
{
static void Main(string[] args)