congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
RequestOpCode
Code IndexAdd Tabnine to your IDE (free)

How to use
RequestOpCode
in
com.eightkdata.mongowp.messages.request

Best Java code snippets using com.eightkdata.mongowp.messages.request.RequestOpCode (Showing top 4 results out of 315)

origin: com.8kdata.mongowp/mongowp-core

 public boolean canReply() {
  return this.equals(OP_QUERY) || this.equals(OP_GET_MORE);
 }
}
origin: com.8kdata.mongowp.server/wp-layer

 private static void checkDecoderMap(Map<RequestOpCode, MessageDecoder<?>> decoderMap) {
  Set<RequestOpCode> opsWithoutDecoder = EnumSet.of(RequestOpCode.OP_MSG, RequestOpCode.RESERVED);
  for (RequestOpCode value : RequestOpCode.values()) {
   if (opsWithoutDecoder.contains(value)) {
    continue;
   }
   if (!decoderMap.containsKey(value)) {
    throw new AssertionError("There is no decoder for operation " + value);
   }
  }
 }
}
origin: com.8kdata.mongowp.server/wp-layer

 @Override
 protected void decodeLittleEndian(
   ChannelHandlerContext channelHandlerContext, ByteBuf byteBuf, List<Object> objects
 ) throws Exception {
  if (byteBuf instanceof EmptyByteBuf) {
   //TODO: This is a workaround. Check how to prevent calling decode on channel inactive
   return;
  }

  // Header
  final RequestBaseMessage requestBaseMessage = BaseMessageDecoder.decode(
    channelHandlerContext, byteBuf);
  byteBuf.skipBytes(Ints.BYTES);  // Ignore responseTo field in header
  int requestOpCodeInt = byteBuf.readInt();
  RequestOpCode requestOpCode = RequestOpCode.getByOpcode(requestOpCodeInt);
  if (null == requestOpCode) {
   LOGGER.warn(INVALID_OPCODE_MESSAGE + requestOpCodeInt);
   throw new IllegalOperationException(requestOpCodeInt);
  }

  // Body
  MessageDecoder<?> messageDecoder = decoderLocator.getByOpCode(requestOpCode);
  if (null == messageDecoder) {
   LOGGER.error(OPERATION_NOT_IMPLEMENTED + requestOpCode);
   throw new UnsupportedOperationException(OPERATION_NOT_IMPLEMENTED + requestOpCode);
  }

  objects.add(messageDecoder.decode(byteBuf, requestBaseMessage));
 }
}
origin: com.8kdata.mongowp.server/mongo-server-api

 @Override
 public boolean handleError(RequestOpCode requestOpCode, MessageReplier messageReplier,
   Throwable throwable) {
  Connection connection = getConnection(messageReplier);

  ReplyMessage handleMongodbException;
  if (throwable instanceof MongoException) {
   handleMongodbException = errorHandler.handleMongodbException(connection,
     messageReplier.getRequestId(),
     requestOpCode.canReply(),
     (MongoException) throwable
   );
  } else {
   handleMongodbException = errorHandler.handleUnexpectedError(
     connection,
     messageReplier.getRequestId(),
     requestOpCode.canReply(),
     throwable
   );
  }
  if (requestOpCode.canReply() && handleMongodbException != null) {
   messageReplier.replyMessage(handleMongodbException);
  }
  return true;
 }
}
com.eightkdata.mongowp.messages.requestRequestOpCode

Most used methods

  • canReply
  • equals
  • getByOpcode
  • values

Popular in Java

  • Creating JSON documents from java classes using gson
  • notifyDataSetChanged (ArrayAdapter)
  • getExternalFilesDir (Context)
  • scheduleAtFixedRate (Timer)
  • Rectangle (java.awt)
    A Rectangle specifies an area in a coordinate space that is enclosed by the Rectangle object's top-
  • FileReader (java.io)
    A specialized Reader that reads from a file in the file system. All read requests made by calling me
  • BasicDataSource (org.apache.commons.dbcp)
    Basic implementation of javax.sql.DataSource that is configured via JavaBeans properties. This is no
  • Logger (org.apache.log4j)
    This is the central class in the log4j package. Most logging operations, except configuration, are d
  • Join (org.hibernate.mapping)
  • SAXParseException (org.xml.sax)
    Encapsulate an XML parse error or warning.> This module, both source code and documentation, is in t
  • Best IntelliJ plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now