All Downloads are FREE. Search and download functionalities are using the official Maven repository.

nstream.adapter.common.ext.RedisIngressJetTranslator Maven / Gradle / Ivy

There is a newer version: 4.14.22
Show newest version
// Copyright 2015-2024 Nstream, inc.
//
// Licensed under the Redis Source Available License 2.0 (RSALv2) Agreement;
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     https://redis.com/legal/rsalv2-agreement/
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package nstream.adapter.common.ext;

import java.util.Map;
import java.util.Properties;
import swim.structure.Record;
import swim.util.Log;

class RedisIngressJetTranslator extends JetTranslator {

  private static final Map ENTRIES = Map.of(
      "poolProvisionName", Entry.STRING,
      "streams", Entry.STRING,
      "group", Entry.STRING,
      "consumer", Entry.STRING,
      "block", Entry.LONG,
      "count", Entry.LONG,
      "relaySchema", Entry.RECON
  );

  RedisIngressJetTranslator() {
    super(RedisIngressSettings.form().tag());
  }

  @Override
  public RedisIngressSettings translate(Log log, RedisIngressSettings settings, Properties unified) {
    return translate(log, settings, RedisIngressSettings.form(), unified);
  }

  @Override
  public Record moldFromProperties(Log log, Properties p) {
    return moldFromProperties(log, p, ENTRIES);
  }

  @Override
  protected Record negotiateSchemas(Log log, RedisIngressSettings settings, Record mold, Properties unified) {
    // No-op: Redis has no content type negotiation
    throw new UnsupportedOperationException("Redis does not have content type negotiation");
  }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy