Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View bogdangaliceanu's full-sized avatar

Bogdan Galiceanu bogdangaliceanu

  • Recognos
  • Romania
View GitHub Profile
@bogdangaliceanu
bogdangaliceanu / NeptuneInstanceDescriber.cs
Created August 26, 2022 15:29
Amazon Neptune Autoscaling - NeptuneInstanceDescriber
public interface INeptuneInstanceDescriber : IDisposable
{
Task<(DBInstance Writer, ImmutableArray<DBInstance> Readers)> GetInstances(string clusterIdentifier);
}
// provides the current cluster topology (i.e. the instances that exist and their availability)
// see https://docs.aws.amazon.com/neptune/latest/userguide/api-instances.html#DBInstance and related pages
public class NeptuneInstanceDescriber : INeptuneInstanceDescriber
{
private readonly IAmazonNeptune neptune;
@bogdangaliceanu
bogdangaliceanu / GremlinStatusProvider.cs
Created August 26, 2022 15:29
Amazon Neptune Autoscaling - GremlinStatusProvider
public interface IGremlinStatusProvider : IDisposable
{
Task<GremlinStatus> Get(string address, int port);
}
// returns the status of an instance, as described in https://docs.aws.amazon.com/neptune/latest/userguide/gremlin-api-status.html
public class GremlinStatusProvider : IGremlinStatusProvider
{
private readonly HttpClient httpClient;
@bogdangaliceanu
bogdangaliceanu / DynamicNeptuneGraphDb.cs
Last active August 26, 2022 15:28
Amazon Neptune autoscaling
public sealed class DynamicNeptuneGraphDb : IDisposable
{
private static readonly ILogger Logger = LogManager.GetCurrentClassLogger();
private readonly NeptuneConfiguration configuration;
private readonly IGremlinStatusProvider gremlinStatusProvider;
private readonly IGremlinClientFactory clientFactory;
private readonly INeptuneRefreshScheduler refreshScheduler;
private readonly INeptuneInstanceDescriber neptuneInstanceDescriber;
private readonly ManualResetEventSlim refreshLock = new(false, 0);
@bogdangaliceanu
bogdangaliceanu / keybase.md
Created October 10, 2014 08:42
Keybase proof

Keybase proof

I hereby claim:

  • I am bogdangaliceanu on github.
  • I am bogdangaliceanu (https://keybase.io/bogdangaliceanu) on keybase.
  • I have a public key whose fingerprint is 9AB2 09F1 3AAE 9930 EE8E 10C1 92EB 50EE 04FF 21BD

To claim this, I am signing this object: