1 /* 2 Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. 3 4 This program is free software; you can redistribute it and/or modify 5 it under the terms of the GNU General Public License, version 2.0, 6 as published by the Free Software Foundation. 7 8 This program is also distributed with certain software (including 9 but not limited to OpenSSL) that is licensed under separate terms, 10 as designated in a particular file or component or in included license 11 documentation. The authors of MySQL hereby grant you an additional 12 permission to link the program and your derivative works with the 13 separately licensed software that they have included with MySQL. 14 15 This program is distributed in the hope that it will be useful, 16 but WITHOUT ANY WARRANTY; without even the implied warranty of 17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 GNU General Public License, version 2.0, for more details. 19 20 You should have received a copy of the GNU General Public License 21 along with this program; if not, write to the Free Software 22 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 23 */ 24 /* 25 * NdbScanOperation.java 26 */ 27 28 package com.mysql.ndbjtie.ndbapi; 29 30 import java.nio.ByteBuffer; 31 32 import com.mysql.jtie.Wrapper; 33 import com.mysql.jtie.ArrayWrapper; 34 35 public class NdbScanOperation extends NdbOperation implements NdbScanOperationConst 36 { getNdbTransaction()37 public final native NdbTransaction/*_NdbTransaction *_*/ getNdbTransaction() /*_const_*/; 38 public interface /*_enum_*/ ScanFlag 39 { 40 int SF_TupScan = 1<<16, 41 SF_DiskScan = 2<<16, 42 SF_OrderBy = 1<<24, 43 SF_Descending = 2<<24, 44 SF_ReadRangeNo = 4<<24, 45 SF_MultiRange = 8<<24, 46 SF_KeyInfo = 1; 47 } 48 public interface /*_struct_*/ ScanOptionsConst 49 { optionsPresent()50 long/*_Uint64_*/ optionsPresent(); 51 public interface /*_enum_*/ Type 52 { 53 int SO_SCANFLAGS = 0x01, 54 SO_PARALLEL = 0x02, 55 SO_BATCH = 0x04, 56 SO_GETVALUE = 0x08, 57 SO_PARTITION_ID = 0x10, 58 SO_INTERPRETED = 0x20, 59 SO_CUSTOMDATA = 0x40; 60 } scan_flags()61 int/*_Uint32_*/ scan_flags(); parallel()62 int/*_Uint32_*/ parallel(); batch()63 int/*_Uint32_*/ batch(); extraGetValues()64 NdbOperation.GetValueSpecArray/*_NdbOperation.GetValueSpec *_*/ extraGetValues(); numExtraGetValues()65 int/*_Uint32_*/ numExtraGetValues(); partitionId()66 int/*_Uint32_*/ partitionId(); interpretedCode()67 NdbInterpretedCodeConst/*_const NdbInterpretedCode *_*/ interpretedCode(); 68 // MMM! support <out:BB> or check if needed: ByteBuffer/*_void *_*/ customData(); 69 } 70 static public class /*_struct_*/ ScanOptions extends Wrapper implements ScanOptionsConst 71 { optionsPresent()72 public final native long/*_Uint64_*/ optionsPresent(); scan_flags()73 public final native int/*_Uint32_*/ scan_flags(); parallel()74 public final native int/*_Uint32_*/ parallel(); batch()75 public final native int/*_Uint32_*/ batch(); extraGetValues()76 public final native NdbOperation.GetValueSpecArray/*_NdbOperation.GetValueSpec *_*/ extraGetValues(); numExtraGetValues()77 public final native int/*_Uint32_*/ numExtraGetValues(); partitionId()78 public final native int/*_Uint32_*/ partitionId(); interpretedCode()79 public final native NdbInterpretedCodeConst/*_const NdbInterpretedCode *_*/ interpretedCode(); 80 // MMM! support <out:BB> or check if needed: public final native ByteBuffer/*_void *_*/ customData(); optionsPresent(long p0)81 public final native void optionsPresent(long/*_Uint64_*/ p0); scan_flags(int p0)82 public final native void scan_flags(int/*_Uint32_*/ p0); parallel(int p0)83 public final native void parallel(int/*_Uint32_*/ p0); batch(int p0)84 public final native void batch(int/*_Uint32_*/ p0); extraGetValues(NdbOperation.GetValueSpecArray p0)85 public final native void extraGetValues(NdbOperation.GetValueSpecArray/*_NdbOperation.GetValueSpec *_*/ p0); numExtraGetValues(int p0)86 public final native void numExtraGetValues(int/*_Uint32_*/ p0); partitionId(int p0)87 public final native void partitionId(int/*_Uint32_*/ p0); interpretedCode(NdbInterpretedCodeConst p0)88 public final native void interpretedCode(NdbInterpretedCodeConst/*_const NdbInterpretedCode *_*/ p0); 89 // MMM! support <out:BB> or check if needed: public final native void customData(ByteBuffer/*_void *_*/ p0); create()90 static public final native ScanOptions create(); delete(ScanOptions p0)91 static public final native void delete(ScanOptions p0); 92 } readTuples(int lock_mode , int scan_flags , int parallel , int batch )93 public /*_virtual_*/ native int readTuples(int/*_LockMode_*/ lock_mode /*_= LM_Read_*/, int/*_Uint32_*/ scan_flags /*_= 0_*/, int/*_Uint32_*/ parallel /*_= 0_*/, int/*_Uint32_*/ batch /*_= 0_*/); nextResult(boolean fetchAllowed , boolean forceSend )94 public final native int nextResult(boolean fetchAllowed /*_= true_*/, boolean forceSend /*_= false_*/); 95 // MMM! support <out:char *> or check if needed: public final native int nextResult(const char * * out_row_ptr, boolean fetchAllowed, boolean forceSend); close(boolean forceSend , boolean releaseOp )96 public final native void close(boolean forceSend /*_= false_*/, boolean releaseOp /*_= false_*/); lockCurrentTuple()97 public final native NdbOperation/*_NdbOperation *_*/ lockCurrentTuple(); lockCurrentTuple(NdbTransaction lockTrans)98 public final native NdbOperation/*_NdbOperation *_*/ lockCurrentTuple(NdbTransaction/*_NdbTransaction *_*/ lockTrans); updateCurrentTuple()99 public final native NdbOperation/*_NdbOperation *_*/ updateCurrentTuple(); updateCurrentTuple(NdbTransaction updateTrans)100 public final native NdbOperation/*_NdbOperation *_*/ updateCurrentTuple(NdbTransaction/*_NdbTransaction *_*/ updateTrans); deleteCurrentTuple()101 public final native int deleteCurrentTuple(); deleteCurrentTuple(NdbTransaction takeOverTransaction)102 public final native int deleteCurrentTuple(NdbTransaction/*_NdbTransaction *_*/ takeOverTransaction); lockCurrentTuple(NdbTransaction takeOverTrans, NdbRecordConst result_rec, ByteBuffer result_row , byte[] result_mask , NdbOperation.OperationOptionsConst opts , int sizeOfOptions )103 public final native NdbOperationConst/*_const NdbOperation *_*/ lockCurrentTuple(NdbTransaction/*_NdbTransaction *_*/ takeOverTrans, NdbRecordConst/*_const NdbRecord *_*/ result_rec, ByteBuffer/*_char *_*/ result_row /*_= 0_*/, byte[]/*_const unsigned char *_*/ result_mask /*_= 0_*/, NdbOperation.OperationOptionsConst/*_const NdbOperation.OperationOptions *_*/ opts /*_= 0_*/, int/*_Uint32_*/ sizeOfOptions /*_= 0_*/); updateCurrentTuple(NdbTransaction takeOverTrans, NdbRecordConst attr_rec, String attr_row, byte[] mask , NdbOperation.OperationOptionsConst opts , int sizeOfOptions )104 public final native NdbOperationConst/*_const NdbOperation *_*/ updateCurrentTuple(NdbTransaction/*_NdbTransaction *_*/ takeOverTrans, NdbRecordConst/*_const NdbRecord *_*/ attr_rec, String/*_const char *_*/ attr_row, byte[]/*_const unsigned char *_*/ mask /*_= 0_*/, NdbOperation.OperationOptionsConst/*_const NdbOperation.OperationOptions *_*/ opts /*_= 0_*/, int/*_Uint32_*/ sizeOfOptions /*_= 0_*/); deleteCurrentTuple(NdbTransaction takeOverTrans, NdbRecordConst result_rec, ByteBuffer result_row , byte[] result_mask , NdbOperation.OperationOptionsConst opts , int sizeOfOptions )105 public final native NdbOperationConst/*_const NdbOperation *_*/ deleteCurrentTuple(NdbTransaction/*_NdbTransaction *_*/ takeOverTrans, NdbRecordConst/*_const NdbRecord *_*/ result_rec, ByteBuffer/*_char *_*/ result_row /*_= 0_*/, byte[]/*_const unsigned char *_*/ result_mask /*_= 0_*/, NdbOperation.OperationOptionsConst/*_const NdbOperation.OperationOptions *_*/ opts /*_= 0_*/, int/*_Uint32_*/ sizeOfOptions /*_= 0_*/); 106 } 107