Exemplo n.º 1
0
        public static async Task <Response> ReloadTrainingDataAsync(Operation baseOperation, RecServiceState state, CancellationToken cancellationToken)
        {
            Operation <ReloadTrainingDataRequest> operation = (Operation <ReloadTrainingDataRequest>)baseOperation;
            ReloadBehavior behavior = (ReloadBehavior)Enum.Parse(typeof(ReloadBehavior), operation.Payload.Mode);
            await state.ReloadTrainingDataAsync(behavior, operation.Payload.Finalize, cancellationToken);

            return(new Response());
        }
Exemplo n.º 2
0
        public Task ReloadTrainingDataAsync(ReloadBehavior behavior, bool finalize, TimeSpan timeout, CancellationToken cancellationToken)
        {
            Operation <ReloadTrainingDataRequest> operation = new Operation <ReloadTrainingDataRequest>(
                opName: OperationTypes.ReloadTrainingData,
                payload: new ReloadTrainingDataRequest(behavior, finalize)
                );

            return(DoOperationWithoutResponseBodyAsync(operation, timeout, cancellationToken, descriptionForErrors: "reloading training data"));
        }
Exemplo n.º 3
0
        public Task ReloadTrainingDataAsync(ReloadBehavior behavior, bool finalize, CancellationToken cancellationToken)
        {
            switch (behavior)
            {
            case ReloadBehavior.LowMemory:
                return(ReloadTrainingDataLowMemoryAsync(finalize, cancellationToken));

            case ReloadBehavior.HighAvailability:
                return(ReloadTrainingDataHighAvailabilityAsync(finalize, cancellationToken));

            default:
                throw new Exception(string.Format("Unexpected ReloadBehavior: {0}", behavior));
            }
        }
 public ReloadTrainingDataRequest(ReloadBehavior mode, bool finalize)
 {
     Mode     = mode.ToString();
     Finalize = finalize;
 }
 public ReloadTrainingDataRequest(ReloadBehavior mode, bool finalize)
 {
     Mode = mode.ToString();
     Finalize = finalize;
 }
Exemplo n.º 6
0
 private void Start()
 {
     animator       = GetComponent <Animator>();
     reloadBehavior = animator.GetBehaviour <ReloadBehavior>();
     reloadBehavior.scopeController = this;
 }
Exemplo n.º 7
0
 public void ReloadTrainingData(ReloadBehavior behavior, bool finalize)
 {
     switch (behavior)
     {
         case ReloadBehavior.LowMemory:
             ReloadTrainingDataLowMemory(finalize);
             break;
         case ReloadBehavior.HighAvailability:
             ReloadTrainingDataHighAvailability(finalize);
             break;
         default:
             throw new Exception(string.Format("Unexpected ReloadBehavior: {0}", behavior));
     }
 }